# Tagging data based on lookup table

**URL:** <https://discuss.elastic.co/t/tagging-data-based-on-lookup-table/250097>\
**Category:** Elasticsearch\
**Created:** [September 27, 2020, 5:09pm UTC](https://discuss.elastic.co/t/tagging-data-based-on-lookup-table/250097 "2020-09-27T17:09:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adi\_Pacht](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adi_pacht/32/76278_2.png) [@Adi\_Pacht](https://discuss.elastic.co/u/Adi_Pacht)\
**Post date:** [September 27, 2020, 5:09pm UTC](https://discuss.elastic.co/t/tagging-data-based-on-lookup-table/250097/1 "2020-09-27T17:09:48Z")

</div>

Hey everyone,  
I’m trying to tag my data according to a lookup table.  
The lookup table has these fields:

• _Key_- represent the field name in the data I want to tag.  
In the real data the field is a subfield of “Headers” field..  
An example for the “Key” field:  
“Server. (\* is a wildcard)

• _Value_- represent the wanted value of the mantioned field above.  
The value in the lookup table is only a part of a string in the real data value.  
An example for the “Value” field:  
“Avtech”.

• _Vendor_- the value I want to add to the real data if a combination of field- value is found in an document.

An example for combination in the real data:  
“Headers.Server : Linux/2.x UPnP/1.0 Avtech/1.0”

A match with that document in the look up table will be:  
Key= Server (with wildcard on both sides)  
Value= Avtech (with wildcard on both sides)  
Vendor= Avtech

So baisically I’ll need to add a field to that document with the value- “ Avtech”.

- the subfields in “Headers” are dynamic fields that changes from document to document.
- of a match is not found I’ll need to add to the tag field with value- “Unknown”.

I’ve tried to use the enrich processor , use the lookup table as the source data , the match field will be ”Value” and the enrich field will be “Vendor”.  
In the enrich processor I didn’t know how to call to the field since it’s dynamic and I wanted to search if the value is anywhere in the “Headers” subfields.  
Also, I don’t think that there will be a match between the “Value” in the lookup table and the value of the Headers subfield, since “Value” field in the lookup table is a substring with wildcards on both sides.

I can use some help to accomplish what I’m trying to do.. and how to search with wildcards inside an enrich processor.

Thanks!  
Adi.

---

<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:** [October 25, 2020, 5:09pm UTC](https://discuss.elastic.co/t/tagging-data-based-on-lookup-table/250097/2 "2020-10-25T17:09:48Z")

</div>

Closed on October 25, 2020, 5:09pm UTC

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