Getting Data In

splitting multiple event and display data using table

sjothi1
New Member

I have splitted my mixed log which contains both text and json to table .
For reference I have queried it as a table as shown below:

alt text

and used the below query to extract the fields like splunkId,processId, processLogId

index=****source=****  | sort -time | fields _time _raw  
| eval data = replace(_raw,"}\n{","Processed SplunkLogger") | eval data = replace(data,"{"," ")     
| eval data = replace(data,"}"," ")  | eval data = split(data,"Processed SplunkLogger") 
| where like(data, "%levelIndicator='****'%") | mvexpand data  |  eval _raw=data | table splunkId,processId, processLogId

But it doesn't returns anything, Can anyone please help me out with it.

0 Karma

skalliger
Motivator

So, where to start.. First of all, you started with a | fields _time _raw. Those fields are always included and cannot be exluced. Later however, you want to table fields that are not available anymore (splunkdId, processId, processLogId).
Secondly, why do you have text and JSON both in the same sourcetype (it sounds like you do)? Why don't you split the events into different sourcetypes? If you're extracting JSON data, you won't need to access _raw anymore because JSON will extract fields for you.

Skalli

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...