Splunk Search

question about predict

kiamco
Path Finder

so I have this query that detects anomalies in the errors from a specific source based on the mean absolute value of the residual around the median. but my question is does the predict command and the algorithm that I used accounts for the fluctuations of event counts over the weekend the weekends. because with less users using the product over the weekend hence less errors.
index=summary source=some index
orig_source=some source
ms_level=ERROR OR ms_level=error
NOT event=no-event
| sort -_time
| predict count as prediction algorithm=LLP future_timespan=200 holdback=0
| eval prediction=round(prediction,0)
| eval residual= count - prediction
| streamstats window=400 current=true median(residual) as median
| eval abs_dev=(abs(residual- median ))
| streamstats window=400 current=true median(abs_dev) as median_abs_dev
| eval upper_bound=(median + median_abs_dev * 30)
| eval lower_bound=(median - median_abs_dev * 30)
| eval outlier=if(residual > upper_bound OR residual < lower_bound,1,0)
| table _time,event residual, upper_bound

0 Karma

cmerriman
Super Champion

It should take into account the "seasonality" trend since you are using LLP.
Predict is generally followed by timechart, but i'm not sure what you're data looks like or what the exact output is. if you remove everything after predict and just look at the chart, can you see the predictions fluctuating as expected? if you use timechart before predict and span=1d or whatever span you need, does that change the prediction?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...