У моих данных есть столбец с записанной датой в формате yyyy-MM-dd HH:mm:ss
. Я хотел бы ежедневно индексировать свои данные, но я не уверен, как добавить другой формат даты к моему имени индекса, например measurements-yyyy-mm-dd
без HH:mm:ss
input {
file {
path => "/measurements.txt"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["id", "recorded_date", "unit", "Description", "CostPerUnit"]
}
date {
match => [ "recorded_date", "yyyy-MM-dd HH:mm:ss" ]
source => "@timestamp"
}
date {
match => [ "recorded_date", "yyyy-MM-dd HH:mm:ss" ]
source => "log_day"
}
date_formatter {
source => "log_day"
pattern => "YYYY-MM-dd"
}
mutate {convert => ["ChannelId", "integer"]}
mutate {convert => ["NumberOfUnits", "float"]}
mutate {convert => ["IsOpen", "integer"]}
mutate {convert => ["CostPerUnit", "float"]}
}
output {
elasticsearch{
hosts => "localhost:9200"
index => "measurements-%{log_day}"
document_type => "measurements"
}
stdout {}
}
`
I should have a list of indexes with names like the following:
- measurements-2009-04-01
- measurements-2009-04-02