Hello guys.
I am testing some functionalities of logstash but I am a bit confused about the process of implementing a filter mutate.
Just for testing purpose I have a kiwi syslog generating random logs. Those logs have 2 fields, as follow:
timestamp
message
What I am trying to do is to add an extra field which is the result of the merge of timestamp + message
Sorry for this basic test, but I am trying to understand how this work before I can move to more complex stuff.
So I set a logstash.conf as follow
input {
tcp {
port => 514
}
}
filter {
prune {
whitelist_names =>["timestamp","message","newfield","@metadata" ]
}
mutate {
add_field => {"newfield" => "%{@timestamp}%{message}"}
}
}
output {
kusto {
path => "/tmp/kusto/%{+YYYY-MM-dd-HH-mm-ss}.txt"
ingest_url => "link"
app_id => "ID"
app_key => "Key"
app_tenant => "tenant"
database => "database"
table => "table"
json_mapping => "basicmsg"
}
stdout {
codec => rubydebug
}
}
When I run the configuration, the output Is correct and I can see this:
{
"@timestamp" => 2021-07-22T13:05:04.992Z,
"message" => "<176>Original Address=203.25.150.43 This is a test message generated by Kiwi SyslogGen\r",
"newfield" => "2021-07-22T13:05:04.992Z<176>Original Address=203.25.150.43 This is a test message generated by Kiwi SyslogGen\r"
}
Which is perfect because is exactly what I was looking for.
But when I head to gusto (azure data explorer) and query the database. I don't see the new field, but only the timestamp
and message
Can please somebody be so kind and explain me what I am doing wrong or what am I missing please?