Or more specifically:
logstash.filters.split ] Only String and Array types are splittable. field:event_data.MemberName is of type = NilClass
Hi,
So, I'd like to extract the contents of the string field called: field:event_data.MemberName that is returned from a Winlogbeat.
The string currently reads in the format of:
CN=John Doe,OU=ACME,OU=Users,OU=8,OU=Paris,OU=FR,DC=mybigdomain,DC=com
The goal is to create 3 new fields and extract the certain contents of the string to populate those fields.
The relevant snippet of code I am using (and failing with) is as follows below. As the comments in the code seem to cause the format to become corrupted in the post, a quick summary of what I'm trying to do is:
If the field named event_data.MemberName isn't empty, mutate the event_data.MemberName field (this is my attempt to rid myself of the failure shown at the top of this post.
I'm then trying to split the field event_data.MemberName into an array called dn.
Then I want to reference the 3rd from last array member (in this case the country), and drop it into a new field called 'Country"
I'm just not sure where this is failing as the event_data.MemberName is defined as a string in Kibana when examining the index itself and I'm force converting it to a string even if it's not within Logstash.
filter {
if 'dcs' in [tags] {
if ([event_data.MemberName] != "") {
mutate {
convert => { "event_data.MemberName" => "string" }
}
split{
field => "event_data.MemberName"
target => "dn"
terminator => ","
add_field => { "country" => "%{[dn][-3]}" }
}
Anything obvious I'm missing?
Thanks.