Hi All,
I am trying to map a date field into Elasticsearch to filter the data using "Time picker" in Kibana Dashboard. My CSV file date format is mm/dd/yy with field name "Service Begin Date". So in my config file, I am trying to customize the date field as per ELK standard as below :
date {
match => ["Service Begin Date", "MM/dd/yyyy"]
target => "Service Begin Date"
}
But I am not able to filter the data using "Time Picker". I had gone through the Elasticsearch documentation about Date Format,
(https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-field-mapping.html#date-detection). I am attaching data file with this post and please find the config file below.
Thanks in advance!
- my config file :
input {
file {
path => "/home/snayak/ccfl-data/all_csv_forIndexing/*.csv"
start_position => "beginning"
ignore_older => 3600
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["Individual ID", "Individual County", "Age", "Sex", "Race", "Ethnicity", "Intpreter Needed", "Oral Language", "Written Language", "Program Code", "Program Name", "Provider ID", "Provider Name", "Provider County", "Service Code", "Service Name", "Service Begin Date", "Service End Date", "Frequency", "Units", "Rate", "Amount", "Payment Date", "Fund Code"]
}
mutate {
convert => { "Individual ID" => "integer" }
}
mutate {
convert => {"Age" => "integer"}
}
mutate {
convert => {"Program Code" => "integer"}
}
mutate {
convert => {"Provider ID" => "integer"}
}
mutate {
convert => {"Service Code" => "integer"}
}
mutate {
convert => {"Units" => "integer"}
}
mutate {
convert => {"Rate" => "integer"}
}
mutate {
convert => {"Amount" => "integer"}
}
date {
match => ["Service Begin Date", "MM/dd/yyyy"]
target => "Service Begin Date"
}
date {
match => ["Service End Date", "MM/dd/yyyy"]
target => "Service End Date"
}
date {
match => ["Payment Date", "MM/dd/yyyy"]
target => "Payment Date"
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => "nfocus"
}
stdout {}
}
Data File: