Splunk Dev

Python SDK - using the SDK to erase particular settings from stanzas

anirban_td
Explorer

I am using the Python SDK to add the allow_skew setting to savedsearches. 

See the generalised code snippet below: 

 

import splunklib.client as client

splunk_svc = client.connect(host="localhost", port=8089, username="admin", password="******")
savedsearch = splunk_svc.saved_searches["alert-splnk-test_email_v1"]

new_skew = "5m"
kwargs = {"allow_skew": new_skew}
savedsearch.update(**kwargs).refresh()

 


This code works and adds 'allow_skew = 5m' to the specific savedsearch stanzas in {app/local OR system/local} / savedsearches.conf / [alert-splnk-test_email_v1]
The code can also be extended to more/all savedsearches on the platform.
It also replicates the changes in a SH Cluster, as expected.

I want to have a reliable way to remove/erase the allow_skew setting from specific savedsearches, preferably using the Python SDK.
The setting needs to be removed from the stanza, so that the allow_skew setting from system / local / savedsearches.conf / [default] is picked up.

The only other ways I could think about are: 


Any help is appreciated. 

0 Karma
Get Updates on the Splunk Community!

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...

Uncovering Multi-Account Fraud with Splunk Banking Analytics

Last month, I met with a Senior Fraud Analyst at a nationally recognized bank to discuss their recent success ...

Secure Your Future: A Deep Dive into the Compliance and Security Enhancements for the ...

What has been announced?  In the blog, “Preparing your Splunk Environment for OpensSSL3,”we announced the ...