could please someone explain to me, why logstash keeps ignoring "codec => plain => format" setting, I am trying to set?
Cfg file I am using:
input {
gelf {
host => "[some ip]"
port => 12201
}
}
output {
elasticsearch {
host => "[some ip]"
bind_port => "9301"
}
file {
codec => plain {
format => "%{[time]} | %{[severity]} : /%{[thread]}/ %{[loggername]} (%{[sourcemethodname]}) - %{[message]}"
}
path => "/Users/[some user]/logs/%{host}/%{facility}-%{+YYYY-MM-dd}.log"
}
}
I thought I used the wrong format, tried different combinations like "%{time}" for fields and even tried to use constant text like:
codec => plain {format => "Simple line"}
But nothing seems to work. It outputs to the elasticsearch fine, create folder/files, but outputs it as JSON.
If anyone knows what is going on with it, please help. Thanks.
A codec plugin changes the data representation of an event. Codecs are essentially stream filters that can operate as part of an input or output.
Logstash Inputs The most common inputs used are file, beats, syslog, http, tcp, ssl (recommended), udp, stdin but you can ingest data from plenty of other sources.
sincedb_path just needs to be a directory where logstash has write permission for the registry. sincedb_write_interval defines how often logstash should write the sincedb registry. A larger value puts you at risk in logstash were to crash.
OpenSearch Service supports the logstash-output-opensearch output plugin, which supports both basic authentication and IAM credentials. The plugin works with version 8.1 and lower of Logstash OSS.
Parameter message_format
is deprecated and will be remove in future relases of Logstash. Instead of using message_format
try something like this:
file {
codec => line {
format => "%{[time]} | %{[severity]} : /%{[thread]}/ %{[loggername]} (%{[sourcemethodname]}) - %{[message]}"
}
path => "/Users/[some user]/logs/%{host}/%{facility}-%{+YYYY-MM-dd}.log"
}
PS: your example using codec plain
, try my with line
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With