- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to get the sourcetype in an index and its types like int, string or char etc by api?
kitkit321
Explorer
07-06-2023
07:27 PM
Hi all,
I am new to API.
I want to use api to get all the sourcetype and its type in the index.
what should I do ?
Many Thanks.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
GaetanVP
Contributor
07-10-2023
12:27 AM
Hello @kitkit321,
You could try something like this (if you are connected on your Search Head, otherwise you'll need to replace https://localhost with the url of the Search Head you want to target).
curl -k -u admin:"<your_password>" https://localhost:8089/services/search/jobs -d search="| metadata type=sourcetypes index=<your_index> | table sourcetype"
curl -k -u admin:"<your_password>" https://localhost:8089/services/services/search/jobs/<sid_returned_on_previous_command>/results
Hope it helps !
GaetanVP
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Gr0und_Z3r0
Contributor
07-09-2023
06:03 AM
hi @kitkit321
Use the metadata command to get the details.
|metadata type=sourcetypes index=my_index
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kitkit321
Explorer
07-09-2023
11:28 PM
How can i use the api to do it?
