Hello All,
Here is grok Filter
grok {
match => ["message", "%{DATESTAMP:timestamp1},%{GREEDYDATA:logmsg1},%{GREEDYDATA:logmsg2},%{INT:auth_method1},%{INT:auth_method2},%{GREEDYDATA:logmsg}"]
add_field => [ "Timestamp", "%{timestamp1}" ]
add_field => [ "C1","%{logmsg1}" ]
add_field => [ "C2", "%{logmsg2}" ]
add_field => [ "CT1", "%{auth_method1}" ]
add_field => [ "CT2", "%{auth_method2}" ]
add_field => [ "Status", "%{logmsg}" ]
}
Here is input
02/06/2016 01:01:07,CL Update,,1046,547,pass
Output
"timestamp1" => "02/06/2016 01:01:07",
"logmsg1" => "CL_Update_Unit",
"auth_method1" => "1046",
"auth_method2" => "547",
"logmsg" => "fail",
"Timestamp" => "02/06/2016 01:01:07",
"C1" => "CL_Update_Unit",
"C2" => "%{logmsg2}",
"CT1" => "1046",
"CT2" => "547",
"Status" => "fail"
Issue:
"C2" => "%{logmsg2}" it should be blank, but its storing variable "%{logmsg2}"
Expected Output
"C2" => ""