I have a log like this:
2020-05-22T11:45:21.297418 H 20 mytest.cpp:175 stdlog sql_execute 38533 73 testdb admin 100-xxy {"query_str","client","execution_time_ms","total_time_ms"}
{"select * from mydatabase;","tcp:localhost:4000","27","73"}
My Grok pattern:
filter {
grok {
match => { "message" => "%{GREEDYDATA:timex} %{WORD:Ix} %{NUMBER:nox} %{GREEDYDATA:code} %{WORD:stdlog} %{WORD:type} %{NUMBER:numbery} %{NUMBER:noh} %{WORD:dbtype} %{WORD:loguserx} %{GREEDYDATA:sessionID} %{GREEDYDATA:query_field} %{GREEDYDATA:query_stats}" }
}
}
problem 01:
output:
My result:
sessionID field contains with part of query_field result, and query_field contains with part of the query_stats results.
sessionID result=> 731-ufsN {"myquery","source","time","total_time"} {"select *
query_field result=> from
query_stats result=> db_states;","tcp:myhost:12336","10","15"}
expected result:
sessionID result=> 731-ufsN
query_field result=> {"myquery","client","time","total_time"}
query_stats result=>{"select * db_states;","tcp:myhost:12336","10","15"}
Problem 02:
how can I get each value inside the {"select * db_states;","tcp:myhost:12336","10","15" }.
Any help with this??