# How to mark an event as "Looked At" in Logstash

**URL:** <https://discuss.elastic.co/t/how-to-mark-an-event-as-looked-at-in-logstash/76648>\
**Category:** Logstash\
**Created:** [February 27, 2017, 3:29pm UTC](https://discuss.elastic.co/t/how-to-mark-an-event-as-looked-at-in-logstash/76648 "2017-02-27T15:29:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Hoffman](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@Ben\_Hoffman](https://discuss.elastic.co/u/Ben_Hoffman)\
**Post date:** [February 27, 2017, 3:29pm UTC](https://discuss.elastic.co/t/how-to-mark-an-event-as-looked-at-in-logstash/76648/1 "2017-02-27T15:29:25Z")

</div>

So I am querying Logstash with this query, which returns all the things off of the top of the stack:

```
{
"query": {
"match_all": { }
},
"size": 7,
"_source": {
"includes": ["transport", "dest", "packet_source", "id_orig_p", "id_orig_p", "id_orig_h", "conn_state", "id_resp_h", "id_resp_p", "service", "proto"]
} ,
"sort": [
  {
    "@timestamp": {
    "order": "desc"
  }
}
] 
} 

```

However, as I query the data then I get duplicates if there is no new data coming in. Is there a way to mark each unique event id as "LookedAt" with an integer field or something?

I need to do this to reduce the garbage collection of my queries in C#, but storing all the ID's and doing string comparisons is pretty heavy, and seems unnecessary when I have Logstash.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [February 27, 2017, 6:28pm UTC](https://discuss.elastic.co/t/how-to-mark-an-event-as-looked-at-in-logstash/76648/2 "2017-02-27T18:28:14Z")

</div>

Hmmm. Even though your question is Logstash-related, this is more appropriately asked in the Elasticsearch discussion group, as it is about an Elasticsearch query.

The short answer is no, however. What you are describing would require either:

1. Writing an extra boolean field to each "read" event, which is a delete-then-reindex operation for each document altered, or
2. Pulling all results to a temporary space, and then tracking what has been read _locally,_ by whatever means are available in that local space.

---

<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:** [March 27, 2017, 6:28pm UTC](https://discuss.elastic.co/t/how-to-mark-an-event-as-looked-at-in-logstash/76648/3 "2017-03-27T18:28:45Z")

</div>

Closed on March 27, 2017, 6:28pm UTC

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