Hi thanks, although I get a runtime error when trying to use this. I've been trying to add the time field by itself so then Ill be able to use the range aggregation to get what I want. Would you happen to know the reason why my convert for hour => integer doesnt work. but size does ?
input {
file {
type => "csv"
path => "/home/callum/Desktop/test2/*.csv"
start_position => beginning
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["Date","User","Size","File Type","Device Class","Device Model","File Name","Time"]
}
date {
match => ["Date", "yyyy-MM-dd'T'HH:mm:ssZZ"]
}
mutate {
rename => {"Date" => "Time"}
add_field => {"[hour]" => "%{+HH:mm:ss:z}"}
convert => { "hour" => "integer" }
convert => { "Size" => "integer" }
remove_field => ["message","path","host","type"]
lowercase => ["Date","User","Size","File Type","Device Class","Device Model","File Name"]
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => "a"
}
}