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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...