Splunk Search

How to subtract _time from now()?

raultav
Engager

Hi, guys!

I need to get the difference in hours between _time and now(). How can I get this number?

Labels (2)
Tags (3)
0 Karma
1 Solution

manjunathmeti
Champion

hi @raultav,

Use eval command.

| eval diff=round((now()-_time)/3600, 0)

View solution in original post

manjunathmeti
Champion

hi @raultav,

Use eval command.

| eval diff=round((now()-_time)/3600, 0)
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!

How much can you really learn in 3 minutes?

Observability can certainly be hard to understand – there's a lot of jargon and buzzwords and it seems to ...

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...