Alright, I think I just about have what I'm looking for ...
Any activity that comes over event_data.CommandLine the doesn't have " " quotations around it. I want to rename the field and copy the data from the field into the new one.
This almost seems to work, it creates the new field but it doesn't copy the info over...
filter {
if "(.*?)" not in [event_data.CommandLine] {
mutate {
add_field => {"event_data.Suspicious" => "Suspicious Activity"}
copy => {"event_data.CommandLine" => "event_data.Suspicious" }
}
}
}
This does create the field, event_data.Suspicious but it doesn't copy the data over.
Alright! I think I'm staring to get this, if I can trouble you for one last suggestion, as a final step I need to convert the field to keyword(end goal being to use this in machine learning)
From other discussions on here I put this together but can't get it to work and tried all kinds of combos -
filter {
if [event_id] == 4688 and [event_data][CommandLine] !~ /"(.*?)"/ {
mutate {
add_field => {"event_data.Suspicious" => ""}
}
mutate {
copy => {"[event_data][CommandLine]" => "event_data.Suspicious" }
}
mutate {
convert => ["[event_data][Suspicious]", "keyword"]
}
}
}
... keep getting the dreaded pipeline terminated error.
Whether something is a keyword is determined by the template field mapping in Elasticsearch, it is not a logstash thing. If you are using the default logstash-* template pretty much every string field has a .keyword field added to it.
You should ask a new question over in the Elasticsearch forum.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.