# Logstash stdout event

**URL:** <https://discuss.elastic.co/t/logstash-stdout-event/118247>\
**Category:** Logstash\
**Created:** [February 2, 2018, 3:34pm UTC](https://discuss.elastic.co/t/logstash-stdout-event/118247 "2018-02-02T15:34:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk2](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@elk2](https://discuss.elastic.co/u/elk2)\
**Post date:** [February 2, 2018, 3:34pm UTC](https://discuss.elastic.co/t/logstash-stdout-event/118247/1 "2018-02-02T15:34:07Z")

</div>

I want to print some events from log file before upload to elasticsearch on stdout console but I don't know why don't work this conf file for me.

input{  
file{  
type =\> "log"  
codec =\> "json"  
path =\> "/var/log/test.log"  
start\_position =\> "beginning"  
sincedb\_path =\> "/var/test/sincedb/.sincedb\_log"  
}

filter {

grok {  
match =\> ["message", "%{SYSLOGBASE} %{URIPATH:url}%{GREEDYDATA:datagreedy}"]  
}

if "[http://google.com](http://google.com)" == [url]{  
metrics{  
meter =\> "google\_events"  
add\_tag =\> "google"  
}  
}  
}

output{

if "google" in [tags]{  
stdout {  
codec =\> line { format =\> "count: %{[google\_events][count]} - %[message]"  
}  
}  
elasticsearch {  
index =\> "test"  
hosts =\> ["[http://localhost:9200](http://localhost:9200)"]  
}  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 2, 2018, 6:19pm UTC](https://discuss.elastic.co/t/logstash-stdout-event/118247/2 "2018-02-02T18:19:43Z")

</div>

How do you know the `url` field is ever equal to "[http://google.com](http://google.com)"?

---

<div class="post-metadata">

**Author:** ![elk2](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@elk2](https://discuss.elastic.co/u/elk2)\
**Post date:** [February 5, 2018, 11:47am UTC](https://discuss.elastic.co/t/logstash-stdout-event/118247/3 "2018-02-05T11:47:27Z")

</div>

Only if url field is "[http://google.com](http://google.com)" I want a google event message on standard output that don't work because %[message] on standard output is empty. Elasticsearch upload is work fine because I upload all events.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 5, 2018, 1:40pm UTC](https://discuss.elastic.co/t/logstash-stdout-event/118247/4 "2018-02-05T13:40:57Z")

</div>

And what are you getting in ES?

---

<div class="post-metadata">

**Author:** ![elk2](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@elk2](https://discuss.elastic.co/u/elk2)\
**Post date:** [February 5, 2018, 2:03pm UTC](https://discuss.elastic.co/t/logstash-stdout-event/118247/5 "2018-02-05T14:03:14Z")

</div>

All logs uploaded have:  
timestamp  
source  
destination  
url  
user  
message

---

<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:** [March 5, 2018, 2:03pm UTC](https://discuss.elastic.co/t/logstash-stdout-event/118247/6 "2018-03-05T14:03:41Z")

</div>

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