Logstash... access field into field

Hi everyone, sorry about my English, I know a little.

I want to format into a file with message_format, but I have this structure:

{
"fields":
{
"level":"error",
"role":"xmpp",
"role_version":"0.0.1",
"node":"lager@host",
"pid":"<0.55.0>"
},
"@timestamp":"2014-11-13T10:43:14.463-06:00",
"message":"Error notice!!",
"type":"erlang",
"@version":"1",
"host":"127.0.0.1"
}

This is my logstash config file:

input {
udp {
type => "erlang"
codec => "json"
port => 9125
}
}

output {
stdout {
codec => json
}
file {
path => "/home/erlang/logstash/erlang.log"
message_format => "%{@timestamp} %{type} %{message} %{host}
%{level}"
}
}

I want to show the "level" field, How can I do that?... If I put %{level}
on message_format, on the log file logstash write "%{level}", no "error".

Thanks.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/71045377-ef01-49c2-80cf-886b61d2a4aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The answer:

            message_format => "%{@timestamp} %{type} %{message} 

%{host} %{[fields][level]}"

Thanks!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/61fa6311-33be-4daa-9344-fe5bacee3c9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.