Getting Data In

REST API realtime searches with output_mode set to json

johandk
Path Finder

Not sure if this has been raised before but I couldn't find anything.

curl -k -u admin:changeme https://localhost:8089/services/search/jobs/export -d search="search sourcetype=sometype" -d earliest_time="rt-30m" latest_time="rt"

works perfectly.

curl -k -u admin:changeme https://localhost:8089/services/search/jobs/export -d search="search sourcetype=sometype" -d earliest_time="rt-30m" latest_time="rt" output_mode="json"

Does not return anything. Is this intended behavior or just a missing feature?

Tags (1)
0 Karma
1 Solution

gstewart
Explorer

Add -d to the http post data requests. So in this case, I believe the correct curl string would be:

curl -k -u admin:changeme https://localhost:8089/services/search/jobs/export -d search="search sourcetype=sometype" -d earliest_time="rt-30m" -d latest_time="rt" -d output_mode="json"

View solution in original post

gstewart
Explorer

Add -d to the http post data requests. So in this case, I believe the correct curl string would be:

curl -k -u admin:changeme https://localhost:8089/services/search/jobs/export -d search="search sourcetype=sometype" -d earliest_time="rt-30m" -d latest_time="rt" -d output_mode="json"

ff_djimenez
New Member

This gives me a 404 on Splunk 5.0.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...