Splunk Search

How to create a query that pulls the following fields from each event?

Strangertinz
Path Finder

Can anyone offer some guidance on how to go about creating a query that pulls the following fields from each event 

Start_time (date and time ) — different from _time field 

End_time (date and time ) — different from _time field 

usage_amount ( a whole number) 

 

 

I will like to calculate the time difference between the start and end time and split every event that the start and end time span over one day and split the original event into multiple individual events where each event from the search just returns the modified list of events where the start and end times are within the same day 

0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

ITWhisperer_0-1684045746990.png

 

View solution in original post

0 Karma

Strangertinz
Path Finder

Thanks, I posted some pictures of the data/current SPL query. Let me know if I can provide anything else 

0 Karma

Strangertinz
Path Finder

I attached some picture of the sample data and query thus farScreen Shot 1.png

 

Screen Shot 2.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

ITWhisperer_0-1684045746990.png

 

0 Karma

Strangertinz
Path Finder

This is awesome! Thanks !!!

0 Karma

yuanliu
SplunkTrust
SplunkTrust

You want to start by telling the community about your data. (Anonymize as needed.)  How do you determine what is Start_time, what is End_time, what is usage_amount, etc.?  SPL is just a tool.  Until you can show volunteers how you do it without SPL, we cannot help you craft SPL.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...