# How do I post curl commands in graylog?

**URL:** https://community.graylog.org/t/how-do-i-post-curl-commands-in-graylog/24595
**Category:** Graylog Central (peer support)
**Tags:** curl
**Created:** [July 2, 2022, 1:57pm UTC](https://community.graylog.org/t/how-do-i-post-curl-commands-in-graylog/24595 "2022-07-02T13:57:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sruju333](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/sruju333/32/12221_2.png) [@sruju333](https://community.graylog.org/u/sruju333)
#### Post date: [July 2, 2022, 1:57pm UTC](https://community.graylog.org/t/how-do-i-post-curl-commands-in-graylog/24595/1 "2022-07-02T13:57:00Z")

</div>

Hi,

I recently got started with graylogs and I understand that we can get logs for a particular application using the GUI provided after we specify the below parameters -

- Relative/Absolute time
- Search query  
and then we can download the output as .csv file.

I have already tried this method out, and the problem I faced was that, If I had to obtain logs for every 1 hour interval for a period of 3 days, I had to manually change the time and download the .csv files and arrange it.

For now, I wish to use a different method to obtain the logs. I want to use **curl requests** as the input instead of the GUI.

My Question Is - How/Where do we specify curls instead of using the GUI to get the logs?

I am not much of an expert in graylogs so I didn’t see any option related curls. I already know how to write the curls for graylogs thanks to a comment made by Jan Doberstein, link to post below -

> [@Graylog4 rest api search export](https://community.graylog.org/t/graylog4-rest-api-search-export/18727):
>
> after upgrade to 4.0.2 we cannot use rest api search export: rest api call ‘api/search/universal/keyword/export?query=%22sshd%22&keyword=%22yesterday%22&batch\_size=500&fields=timestamp’ get 0 records back if we use the call ‘api/search/universal/keyword?query=“sshd”&keyword=“yesterday”&batch\_size=500&fields=timestamp%2Csource%2Cmessage’ we are see the messages but in json format was the export disabled in 4.0.2 or is it a bug? Update: if we set limit=-1 then we get records but this field is …

Where do I find the ‘Export API’ mentioned in the comment (in the post above) ?

Im currently using MacOS. (I don’t think that’s useful, but ok.)

Thanks! Looking forward to some help!

---

<div class="post-metadata">

### Author: ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)
#### Post date: [July 4, 2022, 10:18pm UTC](https://community.graylog.org/t/how-do-i-post-curl-commands-in-graylog/24595/2 "2022-07-04T22:18:09Z")

</div>

Hello && Welcome @sruju333

> [@sruju333](#):
>
> Where do I find the ‘Export API’ mentioned in the comment (in the post above) ?

Navigate to System/Nodes → API browser

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/c/ccb65a46a17b32d82253353e32c4f429c17d63a1.png)

---

<div class="post-metadata">

### Author: ![sruju333](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/sruju333/32/12221_2.png) [@sruju333](https://community.graylog.org/u/sruju333)
#### Post date: [July 5, 2022, 11:09am UTC](https://community.graylog.org/t/how-do-i-post-curl-commands-in-graylog/24595/3 "2022-07-05T11:09:09Z")

</div>

Thank you very much.  
‘Export API’ was a confusing term for a beginner.

I was able to find the ‘Export API’ which I needed after accessing the base\_URL/api/api-browser endpoint (same as above) and then going to /search/universal/absolute/export API.

This partially solves my problem, will post another question if the need arises. Thank you once again.

---

<div class="post-metadata">

### Author: ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)
#### Post date: [July 5, 2022, 9:28pm UTC](https://community.graylog.org/t/how-do-i-post-curl-commands-in-graylog/24595/4 "2022-07-05T21:28:33Z")

</div>

Awesome, glad to help. If you could mark this as resolved this will help future search’s 👍

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [July 19, 2022, 9:29pm UTC](https://community.graylog.org/t/how-do-i-post-curl-commands-in-graylog/24595/5 "2022-07-19T21:29:28Z")

</div>

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