# Using Grok fields in stdout

**URL:** <https://discuss.elastic.co/t/using-grok-fields-in-stdout/88311>\
**Category:** Logstash\
**Created:** [June 5, 2017, 5:53pm UTC](https://discuss.elastic.co/t/using-grok-fields-in-stdout/88311 "2017-06-05T17:53:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dolanmk](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dolanmk](https://discuss.elastic.co/u/dolanmk)\
**Post date:** [June 5, 2017, 5:53pm UTC](https://discuss.elastic.co/t/using-grok-fields-in-stdout/88311/1 "2017-06-05T17:53:38Z")

</div>

Hi!

My goal is to be able to stdout a message that uses the fields I have creating using Grok.

I have pasted my output code for my config file. The way I am currently trying is not working. I'm not entirely sure what the output in the console is a result of.

```
output {
  if "_grokparsefailure" not in [tags] {
    elasticsearch {
        hosts => ["cii6w760:9201"]
    }
  }
  if "no_matching_pattern" in [tags] {
    stdout { codec => line {
      format => "message: %{message}"  
     }
    }
  }
}

```

%{message} is one of the fields I created using the Grok plugin

Here is the output in the console:  
`asdfghjkl,mhfvjhl,mhfvjh`

Thank you for your help! If there is any other code you need to see I am glad to post it.

- Miranda

---

<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:** [July 3, 2017, 5:54pm UTC](https://discuss.elastic.co/t/using-grok-fields-in-stdout/88311/2 "2017-07-03T17:54:05Z")

</div>

Closed on July 3, 2017, 5:54pm UTC

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