# Is this still valid syntax for grok filters?

**URL:** <https://discuss.elastic.co/t/is-this-still-valid-syntax-for-grok-filters/222908>\
**Category:** Logstash\
**Created:** [March 10, 2020, 10:15am UTC](https://discuss.elastic.co/t/is-this-still-valid-syntax-for-grok-filters/222908 "2020-03-10T10:15:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![calanon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/calanon/32/64004_2.png) [@calanon](https://discuss.elastic.co/u/calanon)\
**Post date:** [March 10, 2020, 10:15am UTC](https://discuss.elastic.co/t/is-this-still-valid-syntax-for-grok-filters/222908/1 "2020-03-10T10:15:27Z")

</div>

I want to make sure I identify the that the logs are coming from nginx before processing this grok filter, is this syntax still valid in version 7x?

```
filter {
  if [program] == "nginx_access" {
     grok {
         match => { "message" => "%{NGINX_ACCESS}" }
    }
  }
  elseif [program] == "nginx_error" {
     grok {
         match => { "message" => "%{NGINX_ERROR}" }
    }
  }

```

Or should I use source, my logs are coming via a filebeat shipper

---

<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 7, 2020, 10:15am UTC](https://discuss.elastic.co/t/is-this-still-valid-syntax-for-grok-filters/222908/2 "2020-04-07T10:15:28Z")

</div>

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