Hello,
I hope my message finds the Elastic community safe and healthy.
I am trying to import CSV files wherein I want to create a new field - tld
using data from one of the columns being imported.
Source Column name: domain_name
Data will have "." as a separator: example: bbc.co.uk or simpler bbcnews.com
New field name: tld
- Hence using the example tld should hold .co.uk or .com
In both cases I want to create a new field "tld" from domain_name with data after the first "." reading from left to right. Hence I wrote the following configuration but static text got added to "tld".
filter {
csv {
skip_header => "true"
columns => ["num","domain_name","query_time","create_date","update_date","expiry_date","domain_registrar_id","domain_registrar_name","domai> remove_field => ["num"]
}
mutate {
add_field => { "tld1" => "%{domain_name}" }
split => { "tld1" => "." }
add_field => { "tld" => "%{[tld1][1]}" }
remove_field => ["tld1"]
}
}
My current configuration returns the value "%{[tld1][1]}"
for tld in all the entires being imported. I am not sure but is my filter being taken as a string?
I followed the example here: Mutate filter plugin | Logstash Reference [8.1] | Elastic
I am currently running version 7.17.1 of the stack.