Splunk Search

How to create a table to show all the values from the below log lines?

olilloyd
Engager

Log Lines are as given below

Reports
obtained. MyId=NameOne, sId=s0, Reports=true, LogString= url=status.com, Type=base, Available=true, Tag=112434, Token=2356 url=status2.com, Type=error, Available=false, Tag=12345, Token=23567

Reports obtained. MyId=NameTwo, sId=s1, Reports=true, LogString= url=status3.com, Type=base, Available=true, Tag=12345876, Token=2356 

I want to create a table as below

MyId  sId Reports url Type Available Tag Token
NameOne  s0 true status.com base true 112434 2356
NameOne  s0 true status2.com error false 12345 23567
NameTwo  s1 true status3.com base true 12345876 2356

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| rex "MyId=(?<MyId>[^,]+).*sId=(?<sId>[^,]+).*Reports=(?<Reports>[^,]+)"
| rex max_match=0 "(?<set>url.*?Type.*?Available.*?Tag.*?Token\S+)"
| mvexpand set
| rex field=set "url=(?<url>[^,]+).*?Type=(?<Type>[^,]+).*?Available=(?<Available>[^,]+).*?Tag=(?<Tag>[^,]+).*?Token=(?<Token>\S+)"
| table MyId sId Reports url Type Available Tag Token

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| rex "MyId=(?<MyId>[^,]+).*sId=(?<sId>[^,]+).*Reports=(?<Reports>[^,]+)"
| rex max_match=0 "(?<set>url.*?Type.*?Available.*?Tag.*?Token\S+)"
| mvexpand set
| rex field=set "url=(?<url>[^,]+).*?Type=(?<Type>[^,]+).*?Available=(?<Available>[^,]+).*?Tag=(?<Tag>[^,]+).*?Token=(?<Token>\S+)"
| table MyId sId Reports url Type Available Tag Token
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...