What is the grok pattern for this

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
]
]

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"
}

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"
]
]
}

I'm glad you it worked

Regards,

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