Alerting

need some help in creating regex

vineela
Path Finder

Hi,

I have few logs with data as shown below..i need to extract them as fields and create chart using those values.can anyone please help me through:
16/Dec/2021:22:20:32 +1100 [qtp1936628443-884] [correlationId=b25d79ca-2b70-4912-93f4-1dc5f58841c8]  - 2021-12-16T11:20:32.362,,55955f24-a900-e3a7-e053-071bf40a1f09,,,PDS_ERR_API_GET_0001,API GET Call Failed with HTTP Status Code of 4xx Client Error,400,Bad Request,jbcsjhcjehcihdc

i need to extract the values of "PDS_ERR_API_GET_0001" and "400" and "Bad Request"

Thanks in Advance

 

 

 

 

 

Labels (1)
Tags (1)
0 Karma

johnhuang
Motivator

Assuming your data is consistent and have the same number of comma seperated fields.

| rex "(?:[^,]*,){5}(?<event_type>[^,]*)\,(?<event_message>[^,]*),(?<event_code>[^,]*),(?<event_status>[^,]*)"
| table _time event_type event_message event_code event_status
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...