# Logstash config file processing order

**URL:** https://discuss.elastic.co/t/logstash-config-file-processing-order/114927
**Category:** Logstash
**Created:** [January 10, 2018, 5:58pm UTC](https://discuss.elastic.co/t/logstash-config-file-processing-order/114927 "2018-01-10T17:58:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ranieri\_Mazili\_de\_Ol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ranieri_mazili_de_ol/32/15815_2.png) [@Ranieri\_Mazili\_de\_Ol](https://discuss.elastic.co/u/Ranieri_Mazili_de_Ol)
#### Post date: [January 10, 2018, 5:58pm UTC](https://discuss.elastic.co/t/logstash-config-file-processing-order/114927/1 "2018-01-10T17:58:19Z")

</div>

Considering that the basic structure of a logstash.conf is:

> input {  
> ...  
> }  
> filter {  
> ...  
> }  
> output {  
> ...  
> }

Looking above we assume that logstash will process the incoming events on that order (input, filter, output).  
Can I use output first to enrich data (using http output plugin) for example then use a filter and the output again to send it to elasticsearch like below:

> input {  
> ...  
> }  
> output {  
> ...http output...  
> }  
> filter {  
> ...  
> }  
> output {  
> ...elasticsearch...  
> }

Will this work or it will process in the order input, filter, output, ouput?

---

<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: [January 10, 2018, 8:45pm UTC](https://discuss.elastic.co/t/logstash-config-file-processing-order/114927/2 "2018-01-10T20:45:17Z")

</div>

It reads from the inputs, applies the filters and writes to the outputs. The order of the items in the configuration file or files does not matter. Something like

```
output {}
input {}
filter {}

```

works just the same as

```
input {}
filter {}
output {}
```

---

<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: [February 7, 2018, 8:45pm UTC](https://discuss.elastic.co/t/logstash-config-file-processing-order/114927/3 "2018-02-07T20:45:21Z")

</div>

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