Hello,
I came across an old discussion -> Rename or Change Available Fields . Unfortunately in that discussion, the final configuration that worked has not been shared!
I am working on same and wanted to get rid of jsonPayload from the beginning of all fields that starts with it. Basically I just want to remove it.
Per my understanding, by using mutate plugin it doesn't allow to use regex and replace the name of multiple fields.
Also, is there a way to change all upper case field names to lower case.
I am using ES version 7.13.1. Sending logs from google cloud using logstash_pubsub plugin and then passing it through the json filter to parse it and split into more detailed fields.
My current config is very simple
input {
google_pubsub {
project_id => "project-name"
topic => "topic-name-woith-logs"
subscription => "topic-subscription-name"
json_key_file => "/etc/logstash/keys/logstash-sa.json"
}
}
filter {
json {
source => "message"
tag_on_failure => ["_jsonparsefailure"]
skip_on_invalid_json => true
remove_field => ["message"]
}
# to omit publishing cloudaudit logs to ES
if "cloudaudit.googleapis.com" in [logName] { drop { } }
}
output {
elasticsearch {
cloud_id => "${ELASTIC_CLOUD_ID}"
cloud_auth => "${ELASTIC_CLOUD_AUTH}"
index => "logs-%{[resource][labels][project_id]}_%{[resource][labels][namespace_name]}-%{+YYYY.MM.dd}"
}
}
Can some one please help me ?