Dashboards & Visualizations

How to download Reports and Macros from Splunk(by using Splunk SDK for Python)

Satya_P
Explorer
 
Labels (1)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Satya_P 

https://host:<mgmt_port>/services/saved/searches

 

http://localhost:8089/servicesNS/-/app/saved/searches?search=eai:acl.owner%3Duser_name

This endpoint will gives you list of searches.

 

Check this link for more: https://docs.splunk.com/Documentation/Splunk/8.2.1/RESTREF/RESTsearch#saved.2Fsearches

You can try SPL also.

| rest /servicesNS/-/-/saved/searches splunk_server=local

 

https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTconf#configs.2Fconf-.7Bfile.7D

Similarly you can get list of macros.

curl -k -u admin:pass https://localhost:8089/services/configs/conf-macros

 

| rest /servicesNS/-/-/admin/macros count=0 splunk_server=local

 

With Python SDK check this link. You will find example code there.

https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/howtousesplunkpython/howtowork/

I hope this will help you.

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

View solution in original post

Satya_P
Explorer

Thank You Kamlesh ...I have checked it and am able to access my reports and macros.

I will check next part that how to download it by using python.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Satya_P 

Can you please share more details about your requirement?

KV

0 Karma

Satya_P
Explorer

I need to access my current reports and macros from Splunk where it has been created.

so that it can be downloaded and then can be able to commit to git repository .

This needs to be done by Using Splunk sdk for python.

Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Satya_P 

https://host:<mgmt_port>/services/saved/searches

 

http://localhost:8089/servicesNS/-/app/saved/searches?search=eai:acl.owner%3Duser_name

This endpoint will gives you list of searches.

 

Check this link for more: https://docs.splunk.com/Documentation/Splunk/8.2.1/RESTREF/RESTsearch#saved.2Fsearches

You can try SPL also.

| rest /servicesNS/-/-/saved/searches splunk_server=local

 

https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTconf#configs.2Fconf-.7Bfile.7D

Similarly you can get list of macros.

curl -k -u admin:pass https://localhost:8089/services/configs/conf-macros

 

| rest /servicesNS/-/-/admin/macros count=0 splunk_server=local

 

With Python SDK check this link. You will find example code there.

https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/howtousesplunkpython/howtowork/

I hope this will help you.

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

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 ...