Splunk Search

How to find deltas for multiple fields generically

benobviate
Explorer

Currently, the query ... | timechart span=1hr count by term limit=10

gives me

_time apple orange banana

3:00pm 123 138 100

4:00pm 132 102 129

Is there a way to find the deltas of each term without naming each individual field in the query? The reason is because the field names (terms) may change (there are several hundred possible terms).

I only know how to do ... | delta apple p=1 as apple_d

but unfortunately, the apple term might be something else. So I am hoping for soemthing like ... | delta all_fields_except_time* p=1 as field_name_d

Ultimately I want a table like _time apple_d orange_ d banana_d

0 Karma

jonuwz
Influencer

finally a use for untable. !

(not really - it you don't do timechart 1st, you wont be in this predicament )

... | untable _time fruit count | streamstats current=false window=1 global=false first(count) as p_count by fruit | eval delta=p_count-count | xyseries _time fruit delta

realistically, you would do the streamstats, manually calculate the delta, then do timechart on the delta field

martin_mueller
SplunkTrust
SplunkTrust

This will give the absolute delta, with no indication of which value is bigger:

... | streamstats range(*) window=2

The delta command does indeed not like wildcards.

Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...