Getting Data In

REST API Saved Searches POST Duplicating Searches

stranjer
Loves-to-Learn Lots

I'm trying to use the REST API to update a large number of alerts/saved searches across multiple environments. Specifically, I want to update to ensure that CSV's are attached to emails. I'm testing this in a lab on Splunk 8.0.2.

I've tried using both of these:
'curl -u splunk_user:splunk_pass -X POST -sk "https://splunk_ip:8089/services/saved/searches/(search title URL encoded)" -d action.email.sendcsv=1'
'curl -u splunk_user:splunk_pass -X POST -sk "https://splunk_ip:8089/servicesNS/(owner)/(app)/saved/searches/(search title URL encoded)" -d action.email.sendcsv=1'

However, what seems to be happening is that the alerts are being cloned into a report instead of being updated themselves. The name is identical, and the search is being copied over despite not being in the curl request.

Not sure what is going wrong with these API calls. They look correct by my reading of the API documentation, but I may be overlooking something.

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...