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!

Best Practices: Splunk auto adjust pipeline queue

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

Request for Professional Development: Attending .conf26

Winning Over the Boss: Your Pass to .conf26 conf26 is going to be here before you know it. If don't already ...

Casting Call: Compete in Cyber Games

Lights, Camera, SecOps: Apply to Compete in Cyber Games     Think you have what it takes to beat the clock? ...