# Logstash enriching data with lookup

**URL:** <https://discuss.elastic.co/t/logstash-enriching-data-with-lookup/194909>\
**Category:** Logstash\
**Created:** [August 12, 2019, 7:36pm UTC](https://discuss.elastic.co/t/logstash-enriching-data-with-lookup/194909 "2019-08-12T19:36:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![philippkahr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philippkahr/32/100137_2.png) [@philippkahr](https://discuss.elastic.co/u/philippkahr)\
**Post date:** [August 12, 2019, 7:36pm UTC](https://discuss.elastic.co/t/logstash-enriching-data-with-lookup/194909/1 "2019-08-12T19:36:19Z")

</div>

Hi guys,

I currently struggeling in understanding how this can be done within the elastic stack properly. I take netflow data as an input source in netflow. Specifically, I use elastiflow [https://github.com/robcowart/elastiflow](https://github.com/robcowart/elastiflow), thus I need to use Logstash. However, as I understand it, it might be possible to add an ingest pipeline on elasticsearch side to handle the kind of task I want to perform.

So, my router and everything sends data via netflow to logstash, which then sends it to elasticsearch and I see fancy stuff in Kibana.

On the other hand I have a fully managed network and I should know every device. I have a cmdb, which I can export as a csv, or can talk to as an API.

What I would like to do is the following:

- Netflow is received
- Mac, or Hostname, or IP is compared to the cmdb content.
  - if one of those match ==\> add field "known: yes"
  - if none of those match ==\> add field "known:false"

I do know how to manipulate event data, enrich it, extract messages and so on. I cannot figure out, how to load information from a file or an API inside the filter in Logstash. I know, that this might lead to increased CPU% or RAM and the bucket may take longer to be filled properly, depending on the lookups that have to be done. However, how am I even supposed to do this crossreference?

Thanks in advance for any idea.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 12, 2019, 7:50pm UTC](https://discuss.elastic.co/t/logstash-enriching-data-with-lookup/194909/2 "2019-08-12T19:50:29Z")

</div>

You could use a [translate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-translate.html) filter. If you do not like that you could consider an elasticsearch, jdbc\_streaming, http, or memcached filter.

---

<div class="post-metadata">

**Author:** ![philippkahr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philippkahr/32/100137_2.png) [@philippkahr](https://discuss.elastic.co/u/philippkahr)\
**Post date:** [August 12, 2019, 8:28pm UTC](https://discuss.elastic.co/t/logstash-enriching-data-with-lookup/194909/3 "2019-08-12T20:28:31Z")

</div>

> [@Badger](#):
>
> translate

Thanks! I will look into the translate feature. I just saw that this is capable of loading a csv from filesystem. I guess I have to do three translations, to properly match my idea :)!

---

<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:** [September 9, 2019, 8:28pm UTC](https://discuss.elastic.co/t/logstash-enriching-data-with-lookup/194909/4 "2019-09-09T20:28:39Z")

</div>

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