Splunk Search

How can I make a field that contains a time series window group of 3 events?

andrewhnguyen
New Member

Is there a way I can group a window of 3 time points and add it as a field with the last two remaining being ignored?
I'm trying to classify time series patterns using a support vector machine with the Splunk MLTK and I'm unsure how to get the data in these windows.

(ex) My data has the _time and amount fields, and I would like to add the windows field:
1. _time amount windows
2. XX:12:XX 6 [ 6, 8, 4]
3. XX:13 XX 8 [8, 4, 4]
4. XX:14:XX 4 [4, 4, 3]
5. XX:15:XX 4 [ 4, 3, 2]
6. XX:16:XX 3 ...`
7. XX:17:XX 2 ...
`

Tags (1)
0 Karma

to4kawa
Ultra Champion
| makeresults count=2
| streamstats count
| eval _time=if(count=2,relative_time(_time,"-2d@d"),relative_time(_time,"-1d@d")) 
| makecontinuous span=1h _time
| eval amount=random() % 10 +1 
| table _time amount
`comment("from here, the logic")`
| reverse
| streamstats window=3 list(amount) as windows 
| reverse
| eval windows="[ ".mvjoin(windows," ")." ]"

Hi, @andrewhnguyen
how about this?

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...