Splunk Search

How to subtract filed values in a column

ezamit
Explorer

I have AWS Cloudtrail data and want to find out how long an EC2 instance was stopped. Is it possible to subtract the EpochOT from Row 3 to Row 2 and Row 5 to Row 4 etc..

 

ezamit_1-1706715500933.png

 

 

Labels (3)
0 Karma

ezamit
Explorer

😀Thanks Guys. it is working !!!!😀

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ezamit ,

good for you, see next time!

let us know if we can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated by all the contributors 😉

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ezamit,

di you explored the delta command (https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Delta)?

Ciao.

Giuseppe

0 Karma

ezamit
Explorer

Thanks @gcusello . That's a great suggestion.  I added | delta EpochOT p=1 to the search and it gave me the following results

ezamit_0-1706716488185.png

Is there a way we can do every other row in delta. I want Row 3 - Row 2, Row 5 - Row 4, Row 7 - Row 6 etc. Thanks again for your help 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ezamit,

the solution from @ITWhisperer  is perfect!

Ciao.

Giuseppe

ITWhisperer
SplunkTrust
SplunkTrust
| eval "delta(EpochOT)" = if(NO % 2 = 0, null(), 'delta(EpochOT)')
Get Updates on the Splunk Community!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...