Filtering out schema data using REST API call

(Jeff) #1

I hope this is the correct category. I don’t wanna be one of “those” people :slight_smile:

I’m using curl to grab information from the REST API “sources” using this command:

curl -XGET -u user:passwd ‘http://server.domain:9000/api/sources?range=864000&size=5000

I’m getting the information I expect, but am curious if I can filter this any further to exclude the schema information that it is providing that I don’t need. For instance, is it possible to craft the request to only return the data in the “sources”:“object” part of the schema? Now we can filter with awk and sed and get what is needed, but if we could get the filtered output of only the hostnames that are sending logs, that would be awesome.

Thanks for any input.

(Jan Doberstein) #2

you can run a search via the REST API and also request the fields you want to. Check the API Browser to craft the initial string you need and then you can customize that.

(system) closed #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.