Knowledge Management

Realtime search based on macro and changing the macro

phoenixdigital
Builder

Hi All,

We have a realtime search which will fire alerts based on some thresholds which we currently store in macros

So I will dumb down the realtime savedsearch as an example

sourcetype="myData" | head 2 | eval testMacro = `macroThreshold` | where testMacro > 120

We have setup page for our app which allows modification of these macros (can also be done via management)

macros.conf looks something like this

[macroThreshold]
definition = 100

Now the saved search is a realtime search and we are hoping that if someone changes the definition of macroThreshold it will be updated in the realtime search. This doesnt appear to work and it appears to be fixed as the value the macro was when the search was started.

Does anyone have an alternate way for changing this threshold and having it used by the realtime search?

A subsearch will not work as you cannot have realtime subsearches.

Is there a way to force/kill the realtime search to restart using this new value?

Tags (2)

dwaddle
SplunkTrust
SplunkTrust

I've not tested it but a lookup might work. Say you have a lookup threshold.csv defined as

sourcetype,threshold
myData,100

Then your realtime search can be written as

sourcetype="myData" 
| head 2 
| lookup update=true threshold.csv sourcetype OUTPUT threshold
| where threshold > 120

The update=true will explicitly cause realtime searches to pull in updates to the lookup.

Sadly there is probably no good way to manage the lookup file from manager directly.

0 Karma

phoenixdigital
Builder

Ah nice to know about lookup and realtime searches thanks.

As you stated its probably not ideal as it means we need some other interface (possibly external to Splunk) for updating the CSV file.

I suppose I could alter the setup_handler.py to do it though.

Ideally though a way to kick a saved realtime search into restarting would be great.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...