Getting Data In

Send data to other tools using REST API

ubp1252
Explorer

Hi, We have a requirement to send data(all indexes data) to other tool using REST API.How can i display all indexes data using rest API.
I tested with this end point,but it is showing only indexes information not data.
curl -k -u admin:pwd https://IP:8089/services/data/indexes/
How can i display or provide full indexes data if any one use the endpoint?

Labels (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @ubp1252,

You should use search job export endpoint, please try below sample;

curl -k -u admin:pwd https://IP:8089/services/search/jobs/export -d search="search index=abc earliest=-24h" -d output_mode=json
If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

scelikok
SplunkTrust
SplunkTrust

You can edit the search according to your desired fields like below;

curl -k -u admin:pwd https://IP:8089/services/search/jobs/export -d search="search index=abc earliest=-24h | table host index sourcetype _raw" -d output_mode=json
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @ubp1252,

You should use search job export endpoint, please try below sample;

curl -k -u admin:pwd https://IP:8089/services/search/jobs/export -d search="search index=abc earliest=-24h" -d output_mode=json
If this reply helps you an upvote and "Accept as Solution" is appreciated.

ubp1252
Explorer

How to take only few fields like host,index,sourcetype,_raw in command

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...