# Query stream terms via API

**URL:** <https://community.graylog.org/t/query-stream-terms-via-api/28721>\
**Category:** Graylog Central (peer support)\
**Tags:** curl\
**Created:** [May 9, 2023, 3:55pm UTC](https://community.graylog.org/t/query-stream-terms-via-api/28721 "2023-05-09T15:55:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![woland](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/woland/32/14763_2.png) [@woland](https://community.graylog.org/u/woland)\
**Post date:** [May 9, 2023, 3:55pm UTC](https://community.graylog.org/t/query-stream-terms-via-api/28721/1 "2023-05-09T15:55:12Z")

</div>

Hello there!  
In Graylog v3 we used to query `/api/search/universal/absolute/terms` API to get some log metrics.  
For example we queried nginx logs with params: field=status, stacked\_fields=http\_host,upstream\_status to get something like

```auto
"terms": {
    "200 - some.domain.name - 200": 369350,
    "400 - some.domain.name - 400": 28904,
    ... etc.
}

```

In Graylog v4 this API has been removed.  
I tried to use `/api/views/search/sync` to replace terms API, but stuck due to lack of documentation.  
Is there any way to reproduce results of terms API with views/search/sync?

---

<div class="post-metadata">

**Author:** ![Joel\_Duffield](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Joel\_Duffield](https://community.graylog.org/u/Joel_Duffield)\
**Post date:** [May 9, 2023, 7:29pm UTC](https://community.graylog.org/t/query-stream-terms-via-api/28721/2 "2023-05-09T19:29:16Z")

</div>

So i wasn’t here for the terms API, but what you are looking for sounds like you may want to look at the new simple search api in 5.1 (which just hit RC stage)

It allows you in a single call to run a query and return selected fields, including sort etc. And those results can come back as json or csv. It’s been really handy in the testing of it I have done.

---

<div class="post-metadata">

**Author:** ![woland](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/woland/32/14763_2.png) [@woland](https://community.graylog.org/u/woland)\
**Post date:** [May 10, 2023, 8:22am UTC](https://community.graylog.org/t/query-stream-terms-via-api/28721/3 "2023-05-10T08:22:39Z")

</div>

Maybe this will suit my needs, thanks!

---

<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:** [May 24, 2023, 8:22am UTC](https://community.graylog.org/t/query-stream-terms-via-api/28721/4 "2023-05-24T08:22:48Z")

</div>

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