# From Filebeat to Logstash (and next to Elasticsearch) - pipeline processing

**URL:** <https://discuss.elastic.co/t/from-filebeat-to-logstash-and-next-to-elasticsearch-pipeline-processing/322171>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [December 29, 2022, 6:34pm UTC](https://discuss.elastic.co/t/from-filebeat-to-logstash-and-next-to-elasticsearch-pipeline-processing/322171 "2022-12-29T18:34:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rysiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rysiu/32/61919_2.png) [@Rysiu](https://discuss.elastic.co/u/Rysiu)\
**Post date:** [December 29, 2022, 6:34pm UTC](https://discuss.elastic.co/t/from-filebeat-to-logstash-and-next-to-elasticsearch-pipeline-processing/322171/1 "2022-12-29T18:34:11Z")

</div>

Hi,

I'm having trouble getting data to transfer correctly from Filebeat to Logstash (then to Elasticsearch).

When I configure in filebeat.yml output directly to Elasticsearch everything is ok.

However, when I configure in filebeat.yml output to Logstash with the following pipeline:

```auto
input {
  beats {
    port => 5044
  }
}

filter {
    if [event][module] == "apache" {
      grok {
          match => { "message" => "%{COMBINEDAPACHELOG}"}
      }
    }
}

output {
  if [@metadata][pipeline] {
    elasticsearch {
      hosts => ["https://PK-ELK1:9200", "https://PK-ELK2:9200", "https://PK-ELK3:9200"]
      manage_template => false
      index => "%{[@metadata][beat]}-%{[@metadata][version]}"
      action => "create"
      pipeline => "%{[@metadata][pipeline]}"
      cacert => "/etc/logstash/certs/ca.crt"
      user => "elastic"
      password => "ukEXHJ3xMfx+rqxl08cn"

    }
  } else {
    elasticsearch {
      hosts => ["https://PK-ELK1:9200", "https://PK-ELK2:9200", "https://PK-ELK3:9200"]
      manage_template => false
      index => "%{[@metadata][beat]}-%{[@metadata][version]}"
      action => "create"
      cacert => "/etc/logstash/certs/ca.crt"
      user => "elastic"
      password => "xxxxx"
    }
  }
}

```

... I have problems ...

Not all fields that were created with the Filebeat -\> Elasticsearch direct connection are created with the Filebeat -\> Logstash -\> Elasticsearch connection.

During the analysis, for example, when I use Logstash to Elastic fields are not added:

```auto
user.name
user_agent.version
user_agent.os.version
user_agent.os.name
user_agent.os.full
user_agent.name
user_agent.device.name
url.path
traefik.access.user_agent.os_name
traefik.access.user_agent.name
source.ip
event.outcome
event.kind
event.created
event.category

```

What could be the problem here?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [December 29, 2022, 6:40pm UTC](https://discuss.elastic.co/t/from-filebeat-to-logstash-and-next-to-elasticsearch-pipeline-processing/322171/2 "2022-12-29T18:40:56Z")

</div>

Are you using the Apache module in Filebeat?

If you are using modules, the parse is done in Elasticsearch and you should not parse your message with this filter:

```auto
    if [event][module] == "apache" {
      grok {
          match => { "message" => "%{COMBINEDAPACHELOG}"}
      }
    }

```

This could change the message that will arrive at elasticsearch and the ingest pipeline may not work as expected.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [December 30, 2022, 2:35pm UTC](https://discuss.elastic.co/t/from-filebeat-to-logstash-and-next-to-elasticsearch-pipeline-processing/322171/3 "2022-12-30T14:35:42Z")

</div>

You can see [here](https://github.com/logstash-plugins/logstash-patterns-core/blob/main/patterns/ecs-v1/httpd) which fields will get from COMBINEDAPACHELOG.  
Additionally, user\_agent should be parsed with the filter plugin _[useragent](https://www.elastic.co/guide/en/logstash/current/plugins-filters-useragent.html)_

---

<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:** [January 27, 2023, 4:35pm UTC](https://discuss.elastic.co/t/from-filebeat-to-logstash-and-next-to-elasticsearch-pipeline-processing/322171/4 "2023-01-27T16:35:49Z")

</div>

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