I am trying to create a complete GROK pattern on Elasticsearch for the following custom JSON based log:
------------------------DEBUG----------------------------
Date : 2019-12-26 12:18:21,498
METHOD NAME: xyz
{
"methodName": "SMS_POOL_IN",
"Tran_Type": "Response",
"URL": "xyz.abcL",
"ApiResult": "Success",
"Date": "2019/12/26 12:18:21",
"ErrorCode": "00",
"ErrorReason": "Success",
"Msisdn": "9999999",
"CNIC": "99999999",
"RequestID": "1111",
"SR_TranID": "2222",
"Channel": "abc"
}
but when ever I parse this, i get only timestamp from the grok.
I am using grok debugger to test this. Whenever i use greedydata, i get only first json parameter, rest gets ignored, am i missing something here? how can i make a grok from these logs? Any helping hand would be appreciated
I have created below grok
%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}%{SPACE \s}%{GREEDYDATA.*}
and getting following result with this.
{
"GREEDYDATA": [
[
"------------------------DEBUG----------------------------",
"Date : 2019-12-26 12:18:21,498 ",
"METHOD NAME: xyz",
"{",
""methodName": "SMS_POOL_IN",",
""Tran_Type": "Response",",
""URL": "xyz.abcL",",
""ApiResult": "Success",",
""Date": "2019/12/26 12:18:21",",
""ErrorCode": "00",",
""ErrorReason": "Success",",
""Msisdn": "9999999",",
""CNIC": "99999999",",
""RequestID": "1111",",
""SR_TranID": "2222",",
""Channel": "abc"",
"} ",
"",
""
]
],
"SPACE": [
[
"\n",
"\n",
"\n",
"\n ",
"\n ",
"\n ",
"\n ",
"\n ",
"\n ",
"\n ",
"\n ",
"\n ",
"\n ",
"\n ",
"\n ",
"\n",
"",
""
]
]
}
I need to show all these json tags segregated as i need them to populated in seperate tags in ELK