Getting Data In

Simple search using cURL returns empty results

pfabrizi
Path Finder

I tried following a simple cURL request based on the training video and I get no results.

I run my search:
curl -u id:password -k https://server:port/services/search/jobs -d search="search index=windows user=mylogin"

I get back a SID then search the SID for being complete.

curl -u id:password -k https://server:port/services/search/jobs/SID
see that it isDone = 1 then I l try to look at the results:

curl -u id:password -k https://server:port/services/search/jobs/SID/results

get nothing back?

when I execute the same in C# using a web client I get a method not allowed.

Thanks!

0 Karma

shivarpith
Path Finder

you need to add --get -d outputmode=csv (json,xml) etc

curl -k -u id:password https://server:port/services/search/jobs/SID/results --get -d "outputmode=csv" > save to file or as required.

0 Karma

3no
Communicator

Did you try with HTTP POST method ?

curl -k -X POST -u id:password https://server:port/services/search/jobs/SID

3no

0 Karma

gu255363
New Member

Even I am facing the same issue, Is it resolved? I didnt get the desiredoutput when I tried this HTTP Post method. And I am also looking for resultCount value.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...