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

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

"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.

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.

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