What is the grok pattern for this


(satish Mamidipalli) #1

ERROR CODE : -1ERROR MESSAGE : Flow ExceptionERROR : [FFP.0012.0004] Found no valid records.

I need the output like

"ERROR_CODE": [
[
"ERROR CODE" :-1
]
]
"ERROR_MESSAGE": [
[
"ERROR MESSAGE" : Flow ExceptionERROR : [FFP.0012.0004] Found no valid records
]
]


(Jose Campos) #2

Hi there try with this.

%{GREEDYDATA:ERROR_CODE}: %{NUMBER:ERROR_CODE}ERROR MESSAGE : %{GREEDYDATA:ERROR_MESSAGE}

With grok debugger.

{
"ERROR_MESSAGE": "Flow ExceptionERROR\t: [FFP.0012.0004] Found no valid records.",
"ERROR_CODE": "-1"
}


(satish Mamidipalli) #3

Thans Much JOSe.
I used your idea and created this
ERROR CODE : %{BASE10NUM:ERROR_CODE}ERROR MESSAGE : %{GREEDYDATA:ERROR_MESSAGE}

grok pattern

{
"ERROR_CODE": [
[
"-1"
]
],
"ERROR_MESSAGE": [
[
"Flow ExceptionERROR\t: [FFP.0012.0004] Found no valid records"
]
]
}


(Jose Campos) #4

I'm glad you it worked

Regards,


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.