# REST API Get data Error

**URL:** <https://community.graylog.org/t/rest-api-get-data-error/29428>\
**Category:** Graylog Central (peer support)\
**Created:** [July 5, 2023, 7:24am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428 "2023-07-05T07:24:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Belee05](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/belee05/32/15103_2.png) [@Belee05](https://community.graylog.org/u/Belee05)\
**Post date:** [July 5, 2023, 7:24am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/1 "2023-07-05T07:24:34Z")

</div>

hi, all

```auto
curl --location 'http://192.168.3.31:9000/api/search/universal/absolute?query=private_ip%253A192.168.1.112&from=2023-07-05%252014%253A45%253A15.000&to=2023-07-05%252015%253A30%253A15.000&decorate=true' \
--header 'Authorization: Basic xxx' \
--header 'Cookie: authentication=xxx'

```

My graylog environment verison is 5.0.8+4c22532, deploying via docker. I request data with **api-browser** is worked, but it didn’t worked with Postman, curl, python etc. The error message is:_**must not be empty (path = Relative Search Resource.searchRelativeChunked.arg6, invalid Value = null)**_.  
What should I do in this situation? Thanks!!!

---

<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 6, 2023, 4:12am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/3 "2023-07-06T04:12:17Z")

</div>

Hey @Belee05

What are you trying to achieve?

---

<div class="post-metadata">

**Author:** ![Belee05](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/belee05/32/15103_2.png) [@Belee05](https://community.graylog.org/u/Belee05)\
**Post date:** [July 6, 2023, 5:40am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/4 "2023-07-06T05:40:49Z")

</div>

Hi gsmith,  
I’ m trying to search data via graylog rest api, such as: _ **/search/universal/absolute** _. Some URI is worked, such as _ **/api/cluster** _, but /search/universal/absolute is didn’t worked.  
Do you have any solution to resolve this issue?

---

<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 6, 2023, 9:29pm UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/5 "2023-07-06T21:29:35Z")

</div>

Hey @Belee05

> [@Belee05](#):
>
> /search/universal/absolute

What version of Graylog is installed? I just noticed that is Legacy API as of Version 4.3.

EDIT: I tested it out, the easiest way I can tell ya is naviagte to the `API browser --> GET /search/universal/absolute`  
Plugged in all the info.

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

From there the output was null but the Request URL is available.

```auto
https://domain.com:9000/api/search/universal/absolute?query=messages&from=2023-06-04T15%3A34%3A49.000Z&to=2023-06-05T15%3A34%3A49.000Z&limit=10&batch_size=500&fields=message

```

Results:

```auto
[root@graylog ~]# curl -XGET -k https://domain.com:9000/api/search/universal/absolute?query=messages&from=2023-06-04T15%3A34%3A49.000Z&to=2023-06-05T15%3A34%3A49.000Z&limit=10&batch_size=500&fields=message
[1] 1342
[2] 1343
[3] 1344
[4] 1345
[5] 1346
[3] Done to=2023-06-05T15%3A34%3A49.000Z
[root@graylog ~]#

```

---

<div class="post-metadata">

**Author:** ![Belee05](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/belee05/32/15103_2.png) [@Belee05](https://community.graylog.org/u/Belee05)\
**Post date:** [July 7, 2023, 2:28am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/6 "2023-07-07T02:28:04Z")

</div>

Thanks for reply. My Graylog version is 5.1.2. Your Request URL is also available for me, but the output is not json format, because the data is json format on graylog database. I tested it on API browser, the output data is json format. These is any setting need to set?

---

<div class="post-metadata">

**Author:** ![Belee05](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/belee05/32/15103_2.png) [@Belee05](https://community.graylog.org/u/Belee05)\
**Post date:** [July 7, 2023, 2:34am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/7 "2023-07-07T02:34:23Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/1/1f60bbfd87a15157532120d2af69b40d1d334ad9.png)  
There was two URI of **/search/universal/absolute** and the first URI return data is text format, the second is json format. You can test it in your environment.

---

<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 7, 2023, 2:40am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/8 "2023-07-07T02:40:38Z")

</div>

Hey @Belee05  
Yeah I will, give me a sec

EDIT: I get yeah I seen that, Tested it for ya no issues.

```auto
[root@graylog prometheus]# curl -XGET -k https://domain.com:9000/api/search/universal/absolute?query=messages&from=2023-06-04T15%3A34%3A49.000Z&to=2023-06-05T15%3A34%3A49.000Z&decorate=true
[1] 25354
[2] 25355
[3] 25356
[2]- Done from=2023-06-04T15%3A34%3A49.000Z
[root@graylog prometheus]# curl -XGET -k https://domain.com:9000/api/search/universal/absolute?query=messages&from=2023-06-04T15%3A34%3A49.000Z&to=2023-06-05T15%3A34%3A49.000Z&decorate=true
[4] 25426
[5] 25427
[6] 25428
[1] Done curl -XGET -k https://domain.com:9000/api/search/universal/absolute?query=messages
[3] Done to=2023-06-05T15%3A34%3A49.000Z
[5]- Done from=2023-06-04T15%3A34%3A49.000Z
[root@graylog prometheus]#

```

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

---

<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 7, 2023, 2:46am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/9 "2023-07-07T02:46:17Z")

</div>

hey Just an FYI , Im running GL 4.3 so if you still having issues Im not 100% sure but it might be the version.

---

<div class="post-metadata">

**Author:** ![Belee05](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/belee05/32/15103_2.png) [@Belee05](https://community.graylog.org/u/Belee05)\
**Post date:** [July 7, 2023, 3:48am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/10 "2023-07-07T03:48:09Z")

</div>

I get another URI: **/views/search** , the body arg as below. It can resolve my issue. 😃

```auto
{
        "queries": [
          {
            "filter": {
              "filters": [
                {
                    "type": "stream",
                    "id": *stream*
                }
              ],
              "type": "or"
            },
            "timerange": {
                "type": "absolute",
                "from": fr,
                "to": to
            },
            "query": {
                "type": "elasticsearch",
                "query_string": rule
            },
            "search_types": [
                {
                    "limit": 10000,
                    "offset": 0,
                    "sort": [
                        {
                            "field": "timestamp",
                            "order": "DESC"
                        }
                    ],
                    "decorators": [],
                    "type": "messages",
                    "filter": null
                }
            ]
          }
        ]
    }

```

---

<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 7, 2023, 3:59am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/11 "2023-07-07T03:59:47Z")

</div>

Awesome 👍 @Belee05

---

<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 21, 2023, 4:00am UTC](https://community.graylog.org/t/rest-api-get-data-error/29428/12 "2023-07-21T04:00:15Z")

</div>

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