Splunk Search

Ho to differentiate fields with same name but different values

gravi
Explorer

I have log messages that have same field names and i am trying to create a table for the dashboard

My messages are:
{
Message:"App Started"
Timestamp: 2019-11-13 23:15:16.436156
},
{
Message:"App Stopped"
Timestamp: 2019-11-13 23:15:18.536156
}

I need to create table with Message, Start time and stop time.

Since both messages has same field name Timestamp, how can eval and differentiate them?

Tried using if(Message="App Stopped") but it always gets me same value for both fields.

Tags (1)
0 Karma

gfreitas
Builder

I have two options for you:

  1. Divide this into two separate events. This would however only works if you have an ID or something that would tie both events together.
  2. Create another field extraction to extract message1, timestamp1, message2, timestamp2

I would try the option 2 before as this would not require re-indexing data etc.

Cheers

0 Karma
Get Updates on the Splunk Community!

Operationalizing TDIR: Building a More Resilient, Scalable SOC

Optimizing SOC workflows with a unified, risk-based approach to Threat Detection, Investigation, and Response ...

Pro Tips for First-Time .conf Attendees: Advice from SplunkTrust

Heading to your first .Conf? You’re in for an unforgettable ride — learning, networking, swag collecting, ...

Raise Your Skills at the .conf25 Builder Bar: Your Splunk Developer Destination

Calling all Splunk developers, custom SPL builders, dashboarders, and Splunkbase app creators – the Builder ...