Splunk Search

How to fetch relevant data from the different log lines based on a unique ID ?

2chs
Explorer
 
 

Hi There,

I need to fetch some data based on a unique ID from the different log lines can you please help me with the search query.

Example for relevant logs with unique ID will be:

Time=DDMMY ID=001 INFO Requester=Bob

Time=DDMMY ID=001 INFO Request Type=Normal

Time=DDMMYY ID=001 INFO Request Status=success

 

So, need them in this format

Time                ID   Requester Request Type Request Status

DDMMYY        001       Bob               Normal              Success

 

Please Help. Thanks in advance.

 

Labels (6)
0 Karma

to4kawa
Ultra Champion
index=_internal | head 1 | fields _raw
| eval _raw="Time=DDMMY ID=001 INFO Requester=Bob
Time=DDMMY ID=001 INFO Request Type=Normal
Time=DDMMYY ID=001 INFO Request Status=success"
| multikv noheader=t 
| table _raw
| rex "(?<comment>(?# the logic))"
| kv
| stats last(Time) as Time values(Requester) as Requester values(Type) as  Request_Type values(Status) as Request_Status by ID
0 Karma
Get Updates on the Splunk Community!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...