Getting Data In

Splunk HEC extract value incorrect when there is curly braces in value of key-value pairs.

cdp_fap
Observer

Using HTTP Event Collector to receier data. When there is unwanted curly brace(s) in value. Event parse incorrect. How can I extract the data when there is {} in the data?

Tags (1)
0 Karma

to4kawa
Ultra Champion

props.conf

SEDCMD-trim = s/{(.*)}/\1/g s/=([^\"].*?)(,|$)/="\1"\2/g
0 Karma

cdp_fap
Observer

I receiver data via SPLUNK HEC, and the {} is in data, not in the filed name.

0 Karma

to4kawa
Ultra Champion

well, Is it JSON format?

0 Karma

cdp_fap
Observer

Yes JSON fomat. something like: {key1=value1, key2=value2,....key3="xxxx{yyyyy", keyn1=valuen1}. The curly brace in value3 will result incorrect event parse.

0 Karma

to4kawa
Ultra Champion

please provide actual log. (PII data masking)

your log looks like non-valid JSON.

reference: https://www.json.org/json-en.html

0 Karma

cdp_fap
Observer

{RCD=MC, ASID=006F, TIMESTAMP=20132 07.04.48.140 -0400, SMFID=MYSSTEM , TEXT=" +This is a control {line FAPFENG} This is the last message line", path=SYSLOG, timezone=-0400, sourcetype=SYSLOG-logmsg, system=XY}

0 Karma

to4kawa
Ultra Champion

TIMESTAMP=20132 07.04.48.140 -0400 really?
how about my updated answer?

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...