# Help with processing metadata at start of file

**URL:** https://discuss.elastic.co/t/help-with-processing-metadata-at-start-of-file/220740
**Category:** Logstash
**Created:** [February 24, 2020, 11:31pm UTC](https://discuss.elastic.co/t/help-with-processing-metadata-at-start-of-file/220740 "2020-02-24T23:31:24Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [February 25, 2020, 12:20am UTC](https://discuss.elastic.co/t/help-with-processing-metadata-at-start-of-file/220740/2 "2020-02-25T00:20:22Z")

</div>

> [@uppaljs](#):
>
> The first two lines contain the header and the lines afterwards contain data.
> 
> Is there a way in logstash to process the header and add it to every event ?

Take a look at [this](https://discuss.elastic.co/t/parse-log-file-with-two-formats-in-it/166876/2) post.

You must set pipeline.workers to 1 and also [disable](https://github.com/elastic/logstash/issues/10938) the java execution engine to preserve the order of events. The solution does not scale, and I regard all solutions that involve ruby class variables as fragile. But if you need to get the job done that is the approach I would suggest.

---

_[View the full topic](https://discuss.elastic.co/t/help-with-processing-metadata-at-start-of-file/220740)._
