# Create field value based on parsed logs

**URL:** <https://discuss.elastic.co/t/create-field-value-based-on-parsed-logs/174782>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 1, 2019, 12:36pm UTC](https://discuss.elastic.co/t/create-field-value-based-on-parsed-logs/174782 "2019-04-01T12:36:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Striletskyi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_striletskyi/32/43212_2.png) [@Andrew\_Striletskyi](https://discuss.elastic.co/u/Andrew_Striletskyi)\
**Post date:** [April 1, 2019, 12:36pm UTC](https://discuss.elastic.co/t/create-field-value-based-on-parsed-logs/174782/1 "2019-04-01T12:36:26Z")

</div>

Hi guys!

We have SNMP trap logs. We send this logs using filebeat. Our filebeat configuration:

```
- input_type: log
  paths: ["/var/log/snmptrapd.log"]
  fields:
    tagtype: linux
    tagapps: traps
    logtype: traps-diagnostic
  close_timeout: 1h
  multiline.pattern: '[0-9]+-[0-9]+-[0-9]+.[0-9]+:[0-9]+:[0-9]+,[0-9]{3}'
  multiline.negate: true
  multiline.match: after

```

We want to get trap types and assign this value to specific field (I want simply known If It's possible). For example I want to create field trap-type and assign value for this field based on parsed log. Example of log:  
`resourceConservationMode trap from <host>`

I want to assign "resourceConservationMode" to field trap-type. It must be dynamically. So , If it will be new trap type , It will assign new value. I want simply search logs by trap type field. Does It possible?

---

<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:** [April 29, 2019, 12:36pm UTC](https://discuss.elastic.co/t/create-field-value-based-on-parsed-logs/174782/2 "2019-04-29T12:36:40Z")

</div>

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