Hi,
I am using the cloudwatch_logs_importer plugin to read and grok logs from cloudwatch.
It all works fine, but I am facing issues to access a field which is created by the input module itself:
[cloudwatch_logs][log_stream]
test_app.1.xydqwtwpkrgo3gvjppxxh0iar
I want to extract app.1 from this field, but I am unable to access it.
Simply adding a new field based on it already does not work:
mutate {
add_field => { "node" => "%{[cloudwatch_logs][log_stream]}" }
}
And results in a new field:
node %{[cloudwatch_logs][log_stream]}
But does not contain the actual contents.
What am I missing here?
I am using a simple pipeline:
input {
cloudwatch_logs_importer {
log_groups => [ "/group/prod/envx" ]
.........
}
}
filter {
if "SalesCount" in [message] {
grok {
match => {
"message" => "\*SalesCount\* +(%{NUMBER:SalesCount:int});?\*SalesCount\*"
}
mutate {
add_field => { "node" => "%{[cloudwatch_logs][log_stream]}" }
}
}
output {
elasticsearch {
template_name => "app-log-test"
hosts => ['https://elastic:9200']
......
}
}
What am I missing?