Dashboards & Visualizations

How to provide time frame for the search and export format when posting to /search/jobs/export using PostMan ?

ebeid
New Member

I'm doing search through postman to search against https://DomainName:8089/services/search/jobs/export
I do a POST call with this payload search=search%20index%3DINDEXNAME%20QUERY
It is working fine but I have two issues:

  1. I don't know how to provide time range for the search.
  2. I need the results in JSON format, not XML
0 Karma

sbbadri
Motivator

@ebeid

1) time frame: search=search%20index%3DINDEXNAME%20index_earliest =-2d%20index_latest =now%20QUERY
2) outputmode json: search=search%20index%3DINDEXNAME%20index_earliest =-2d%20index_latest =now%20output_mode=json%20QUERY
outputmode xml: search=search%20index%3DINDEXNAME%20index_earliest =-2d%20index_latest =now%20output_mode=xml%20QUERY

by default results will be xml

check below link,

http://docs.splunk.com/Documentation/Splunk/7.0.1/RESTREF/RESTsearch#search.2Fjobs.2Fexport

i hope this helps

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...