Splunk Search

evaluation with condition

zacksoft
Contributor

I have two values x and y. Both values are dynamic (keeps on changing).
x indicates _time and y indicates a value that continuosly changes with time.
I want the value of y at two particular instances of x.

I do this,
|eval mytime = round(_time)
|eval mytime2 = round(_time) - 40

I wish to have value of y when x's value is mytime and
the value of y when x's value is mytime2 (i.e. 40 sec before current time)
If condition only helps to get the value of y when x is mytime, but it won't help when x = mytime2. When x=mytime2 , it still gives the same value as mytime. But it shouldn't be the case.

Tags (1)
0 Karma

493669
Super Champion

could you provide what query you have tried?

0 Karma

493669
Super Champion

could you provide sample inputs and expected output to better understand

0 Karma

zacksoft
Contributor

X | Y
1518074558| 464758
1518074559| 5757657
1518074560| 464533
1518074561| 667231
1518074562| 77654
1518074563| 00987
1518074564 | 567843

X indicates UNIX time.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

What’s New in Splunk AI: Volume 02

Welcome to the second edition of “What’s New in Splunk AI” where we look at the latest and greatest updates, ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...