Splunk Enterprise

Can asterisks (*) be used in search names within the savedsearches.conf?

Sharzi
Explorer

Hi,

I have multiple searches that follow a naming convention like "Server1_Monitoring", "Server2_Monitoring", and so on. I used an asterisk in the search name stanza to match all of them in the savedsearches.conf file, like:

[Server*_Monitoring]

dispatch.ttl=3p

I restarted the search head after the change, but it didn't work. Is there any way to avoid listing all the searches explicitly in savedsearches.conf?

Thank you!

Labels (2)
Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The savedsearches.conf file defines your searches so for Splunk to know what each search is called, it must be explicitly named in the stanza.  Wildcards won't work because the "*" represents a near-infinite set of search names.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

The savedsearches.conf file defines your searches so for Splunk to know what each search is called, it must be explicitly named in the stanza.  Wildcards won't work because the "*" represents a near-infinite set of search names.

---
If this reply helps you, Karma would be appreciated.

FritzWittwer
Path Finder

as you have to be explicit whit stanza names, you could put all this saved searches into a dedicated app, and the set the ttl in the default stanza [default]  for all searches in this app.

 

0 Karma

Sharzi
Explorer

Thank you @richgalloway for your reply!

Since all of the monitoring searches are under my username, would you know a solution to set dispatch.ttl based on the username, not the search names? so all searches under my username would have dispatch.ttl=3p .

richgalloway
SplunkTrust
SplunkTrust

Write a script that uses the REST API to pull a list of saved searches, filters on your name, then updates them with the new TTL.  See https://docs.splunk.com/Documentation/Splunk/9.2.0/RESTREF/RESTsearch#saved.2Fsearches

---
If this reply helps you, Karma would be appreciated.
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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...