Search Splunk with Rest API without a saved search

大兔子大兔子 提交于 2019-12-03 20:54:30

You can specify the search string as a parameter to the export endpoint and get the results without having a saved search on the server.

curl -ku admin:changeme https://localhost:8089/servicesNS/admin/search/search/jobs/export -d search="search index%3D_internal | head 3" -d output_mode=csv

output_mode is an optional parameter. With xml being the default, you can also specify json, csv or xml.

You can also use one of the Splunk SDKs if you want to stick to your choice of language. SDKs make it easier for you to talk to Splunk.

-Neeraj.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!