# Create a search for IOCs

**URL:** <https://discuss.elastic.co/t/create-a-search-for-iocs/368532>\
**Category:** Elasticsearch\
**Created:** [October 9, 2024, 1:17pm UTC](https://discuss.elastic.co/t/create-a-search-for-iocs/368532 "2024-10-09T13:17:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JA\_cintegration](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ja_cintegration/32/138209_2.png) [@JA\_cintegration](https://discuss.elastic.co/u/JA_cintegration)\
**Post date:** [October 9, 2024, 1:17pm UTC](https://discuss.elastic.co/t/create-a-search-for-iocs/368532/1 "2024-10-09T13:17:54Z")

</div>

Trying to create a query search for IPs found in the last 24 hours.  
I have been testing with:

`GET /index/_search`

```auto
{
  "query": {
    "match": {
      "event.category": "network"
    }
  }
}

```

Or:  
`POST /*index_name*/_async_search`

```auto
{
  "query": {
    "range": {
      "@timestamp": {
        "gte": "now-24h",
        "lt": "now"
      }
    }
  },
  "size": 10
}

```

Or:

`POST /index_name*/_async_search?size=0`  
including:  
`POST /index_name*/_async_search?wait_for_completion_timeout=200ms`

```auto
{
  "query": {
    "range": {
      "@timestamp": {
        "gte": "now-24h",
        "lt": "now"
      }
    }
  },
  "size": 10
}

```

I have also used GET /\_search and POST /\_search but in some cases Im able to get an id but the hits are 0. I can search for the id by using the: GET /\_async\_search/ but once again I get 0 for hits.

---

<div class="post-metadata">

**Author:** ![nfeekery](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nfeekery/32/117349_2.png) [@nfeekery](https://discuss.elastic.co/u/nfeekery)\
**Post date:** [October 15, 2024, 3:12pm UTC](https://discuss.elastic.co/t/create-a-search-for-iocs/368532/2 "2024-10-15T15:12:42Z")

</div>

Category updated on October 15, 2024, 3:12pm UTC

From #Elastic Search to #Elasticsearch

---

<div class="post-metadata">

**Author:** ![nfeekery](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nfeekery/32/117349_2.png) [@nfeekery](https://discuss.elastic.co/u/nfeekery)\
**Post date:** [October 15, 2024, 3:12pm UTC](https://discuss.elastic.co/t/create-a-search-for-iocs/368532/3 "2024-10-15T15:12:42Z")

</div>

Tags updated on October 15, 2024, 3:12pm UTC

Removed #elastic-app-search

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 12, 2024, 3:13pm UTC](https://discuss.elastic.co/t/create-a-search-for-iocs/368532/4 "2024-11-12T15:13:14Z")

</div>

Closed on November 12, 2024, 3:13pm UTC

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