Splunk Search

playing with data II

reverse
Contributor

q1- how can i get c4 where c4 will always be difference of values in c3 against first of c2 - next of c2
for example .. here c4 for A = 76-7 .. 7-6 ... 6-677.. and so on

Please guide.

c1  c2  c3
A   1   76
A   2   7
A   3   6
A   4   677
B   1   65
B   2   675
B   3   90
B   4   78
C   1   121
C   2   56
C   3   54
C   4   67
D   1   56
D   2   6
D   3   5
D   4   657
Tags (1)
0 Karma

reverse
Contributor

@Vijeta please guide.

0 Karma

Vijeta
Influencer

@reverse Try this

<your query> | sort c1,c2|streamstats list(c3) as list , count as count by c1| eval diff  = mvindex(list, count-2)| eval c4= c3 - diff
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...