我有这种格式的PHP日志
[Day Mon DD HH:MM:SS YYYY] [Log-Type] [client <ipv4 ip address>] <some php error type>: <other msg with /path/of/a/php/script/file.php and something else>
[Day Mon DD HH:MM:SS YYYY] [Log-Type] [client <ipv4 ip address>] <some php error type>: <other msg without any file name in it>
[Day Mon DD HH:MM:SS YYYY] [Log-Type] [client <ipv4 ip address>] <some msg with out semicolon in it but /path/of/a/file inside the message>
Run Code Online (Sandbox Code Playgroud)
这是我试图通过logstash处理后发送到Graylog2.在这里使用这篇文章,我能够开始.现在我想得到一些额外的字段,以便我的最终版本看起来像这样.
{
"message" => "<The entire error message goes here>", …Run Code Online (Sandbox Code Playgroud) 我有4个数组:
ARRAY1=( A B C D )
ARRAY2=( E F G )
ARRAY3=( H I J K L M )
ARRAY4=( N )
Run Code Online (Sandbox Code Playgroud)
一些我想如何获得一个包含这些元素的新数组:
FINAL_ARRAY=( ARRAY1 A ARRAY1 B ARRAY1 C ARRAY1 D ARRAY2 E ARRAY2 F ARRAY2 G ARRAY3 H ARRAY3 I ARRAY3 J ARRAY3 K ARRAY3 L ARRAY3 M ARRAY4 N )
Run Code Online (Sandbox Code Playgroud)
这可以使用某种for循环或BASH中的任何其他方式来完成吗?
谢谢.