# How to add persistent data to filebeat

**URL:** https://discuss.elastic.co/t/how-to-add-persistent-data-to-filebeat/341981
**Category:** Beats
**Tags:** filebeat
**Created:** [August 30, 2023, 12:09pm UTC](https://discuss.elastic.co/t/how-to-add-persistent-data-to-filebeat/341981 "2023-08-30T12:09:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)
#### Post date: [August 30, 2023, 12:09pm UTC](https://discuss.elastic.co/t/how-to-add-persistent-data-to-filebeat/341981/1 "2023-08-30T12:09:55Z")

</div>

I have some log files that only in the first line it will display the version of the file, but I want to use that version everywhere in the log. is there a way I can store that data and use it for the rest of the file?  
For example:

```auto
2023-01-01 00:00:00 INFO version 3.4.1
2023-01-01 00:00:00 INFO starting application
[...]

```

I want to use that 3.4.1 in all events of my log that are sent to elasticsearch

---

<div class="post-metadata">

### Author: ![Alex\_Salgado-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_salgado-elastic/32/103081_2.png) [@Alex\_Salgado-Elastic](https://discuss.elastic.co/u/Alex_Salgado-Elastic)
#### Post date: [August 30, 2023, 2:14pm UTC](https://discuss.elastic.co/t/how-to-add-persistent-data-to-filebeat/341981/2 "2023-08-30T14:14:40Z")

</div>

You could try use the "set" processor to store de VERSION and use it on ingestion pipeline. Take a look at: [Set processor | Elasticsearch Guide [8.9] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/set-processor.html)

---

<div class="post-metadata">

### Author: ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)
#### Post date: [August 30, 2023, 3:19pm UTC](https://discuss.elastic.co/t/how-to-add-persistent-data-to-filebeat/341981/3 "2023-08-30T15:19:02Z")

</div>

Thanks, but I think this will set the version field in only one event: the first event to be precise, the rest of the events will have it empty

---

<div class="post-metadata">

### Author: ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)
#### Post date: [August 30, 2023, 3:27pm UTC](https://discuss.elastic.co/t/how-to-add-persistent-data-to-filebeat/341981/4 "2023-08-30T15:27:59Z")

</div>

And of course I just can't hard code the version as each log will have different versions

---

<div class="post-metadata">

### Author: ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)
#### Post date: [September 26, 2023, 2:55pm UTC](https://discuss.elastic.co/t/how-to-add-persistent-data-to-filebeat/341981/5 "2023-09-26T14:55:15Z")

</div>

Perhaps the use of enrichment pipelines? but the problem is that the index source will need to be fast

---

<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 24, 2023, 4:55pm UTC](https://discuss.elastic.co/t/how-to-add-persistent-data-to-filebeat/341981/6 "2023-10-24T16:55:44Z")

</div>

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