Refine your search:

I am trying to fetch results using REST API from Saved Search and getting empty response. My command is like this... curl -u admin:changeme -k https://localhost:8089/services/search/jobs -d"search=search sourcetype="estore-om_app" com.symantec.ecom.ep.service.misc.impl.SymEpDataCenterServiceImpl"

Got response sid in below XML format:<sid>1303166708.128</sid>

I used this sid in the below command curl -u admin:changeme -k https://tus1crsappdex215:8089/services/search/jobs/1303166708.128/results/

Please advise me if I am doing something wrong.

asked 18 Apr '11, 15:55

rajiv_kumar's gravatar image

rajiv_kumar
2517
accept rate: 0%


3 Answers:

You have at least one problem here with your POST. You have to escape the = with %3d in the sourcetype=...

Could you try:

curl -u admin:changeme -k https://localhost:8089/services/search/jobs -d'search=search sourcetype%3d"estore-om_app" com.symantec.ecom.ep.service.misc.impl.SymEpDataCenterServiceImpl'

You can also try the "export" mode:

curl -u admin:changeme -k https://localhost:8089/services/search/jobs/export -d'search=search sourcetype%3d"estore-om_app" com.symantec.ecom.ep.service.misc.impl.SymEpDataCenterServiceImpl'

This gives you the results directly. If you want CSV out, you can run this as:

curl -u admin:changeme -k https://localhost:8089/services/search/jobs/export -d'search=search sourcetype%3d"estore-om_app" com.symantec.ecom.ep.service.misc.impl.SymEpDataCenterServiceImpl&output_mode=csv'
link

answered 18 Apr '11, 19:29

Stephen%20Sorkin's gravatar image

Stephen Sorkin ♦
9.0k510
accept rate: 52%

It worked. Thanks Stephen!

(19 Apr '11, 11:47) rajiv_kumar

For export, output_mode=csv is a new addition to 4.2. You will have to upgrade to get this. You can replace export with "oneshot" to get csv out in 4.1.x.

link

answered 19 Apr '11, 12:14

Stephen%20Sorkin's gravatar image

Stephen Sorkin ♦
9.0k510
accept rate: 52%

It worked. But one issue is still there. I am trying to export csv format file and it seems always returning xml format. Here is my command

curl -u admin:changeme -k https://localhost:8089/services/search/jobs/export -d'search=search sourcetype%3d"ebe_abs" PSN earliest%3d-4d&output_mode=csv' >> exporteddata.csv

Can you please advise on this.

Thanks, Rajiv

link

answered 19 Apr '11, 12:02

rajiv_kumar's gravatar image

rajiv_kumar
2517
accept rate: 0%

Great. It worked. Thanks Stephen!

(19 Apr '11, 13:54) rajiv_kumar
Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1,684
×149
×132

Asked: 18 Apr '11, 15:55

Seen: 1,421 times

Last updated: 19 Apr '11, 23:17

Copyright © 2005-2012 Splunk Inc. All rights reserved.