# "SocketError: send: name or service not known" on using GELF output plugin

**URL:** <https://discuss.elastic.co/t/socketerror-send-name-or-service-not-known-on-using-gelf-output-plugin/44832>\
**Category:** Logstash\
**Created:** [March 18, 2016, 11:37am UTC](https://discuss.elastic.co/t/socketerror-send-name-or-service-not-known-on-using-gelf-output-plugin/44832 "2016-03-18T11:37:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mshar039](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mshar039](https://discuss.elastic.co/u/mshar039)\
**Post date:** [March 18, 2016, 11:37am UTC](https://discuss.elastic.co/t/socketerror-send-name-or-service-not-known-on-using-gelf-output-plugin/44832/1 "2016-03-18T11:37:52Z")

</div>

Hi all,  
I am facing an issue with GELF output plugin in Logstash.  
Recently started using Logstash. Wanted to visualize logs in Graylog2 using Logstash. So, gave a basic trail with this.

My config is  
input {  
file {  
path =\> "/root/Desktop/Graylog/test.log"  
start\_position =\> "beginning"  
type =\> "logs"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
if [type] == "logs" {  
mutate {  
add\_field =\> {"message" =\> "%{Message}"}  
}  
}  
}  
output {  
gelf {  
host =\> ["127.0.0.1:9000"]  
}  
}

On using stdout {}, logstash runs fine. But gives error on using gelf output plugin.

Error:  
Trouble sending GELF event {:gelf\_event=\>{"short\_message"=\>["", "%{Message}"], "full\_message"=\>",%{M........"path"=\>"/root/Desktop/Graylog/test.txt", "host"=\>"localhost.localdomain", "type"=\>"grayLog"}, "severity"]}\>\>, :error=\>#SocketError: send: name or service not known\>, :level=:warn}

I have omitted the log and only shown the relevant things.  
Can u please help me with this.

using logstash v2.2 with  
Graylog 1.3  
I am a newbie in linux environment and tools. kindly help me. What could be the reason for this error

---

<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:** [March 19, 2016, 3:42pm UTC](https://discuss.elastic.co/t/socketerror-send-name-or-service-not-known-on-using-gelf-output-plugin/44832/2 "2016-03-19T15:42:37Z")

</div>

"name or service not known" is a standard error message that indicates a problem looking up the name of a host or a service. In your gelf output configuration you have

```
host => ["127.0.0.1:9000"]

```

but the `host` option is supposed to be a hostname or IP address. The documentation does not indicate that including a port number here is allowed. There's a separate `port` option for that.

---

<div class="post-metadata">

**Author:** ![mshar039](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mshar039](https://discuss.elastic.co/u/mshar039)\
**Post date:** [March 21, 2016, 7:05am UTC](https://discuss.elastic.co/t/socketerror-send-name-or-service-not-known-on-using-gelf-output-plugin/44832/3 "2016-03-21T07:05:56Z")

</div>

Thanks @magnusbaeck, my Logstash is working now.

But when I created a GELF UDP input in the Graylog and tried to see all the logs in it, I m not able to see any logs in Graylog. On clicking 'Show Received Messages', it shows 'Nothing found'.

Please help me.

---

<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:** [March 21, 2016, 7:08am UTC](https://discuss.elastic.co/t/socketerror-send-name-or-service-not-known-on-using-gelf-output-plugin/44832/4 "2016-03-21T07:08:34Z")

</div>

I can't help with that. I'm not familiar with Graylog.

---

<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 6, 2017, 5:06am UTC](https://discuss.elastic.co/t/socketerror-send-name-or-service-not-known-on-using-gelf-output-plugin/44832/5 "2017-07-06T05:06:09Z")

</div>


