下个月的Logstash每日索引错误日期格式

时间:2019-05-23 16:29:04

标签: elasticsearch indexing logstash

我有一年要每天索引的数据,今天,当我检查索引时,命名有问题,下个月的day格式将不会恢复为1相反,它从上个月的31 + 1 = 32开始递增。

measurements-2016-01-01
...
..
.
measurements-2016-01-30
measurements-2016-01-31
measurements-2016-02-32 <== WRONG. Should be 1
measurements-2016-02-33 <== WRONG. Should be 2
measurements-2016-02-34 <== WRONG. Should be 3
...
..
.

我试图将自己的logstash输出编辑为YYYY-MM-DD,但这也不起作用。

我的logstash配置

input {
    file {
        path => "measurements.txt"
        start_position => "beginning"
        sincedb_path => "/dev/null"
    }
}
filter {
    csv {
        separator => ","
        columns => ["Id", "Recorded_Date", "Units", "Description", "cpu"]
    }

    date {
        match => [ "Recorded_Date", "yyyy-MM-dd HH:mm:ss" ]
    }

    mutate {convert => ["Id", "integer"]}
    mutate {convert => ["Units", "float"]}
    mutate {convert => ["cpu", "float"]}
}

output {
    elasticsearch{
        hosts => "localhost:9200"
        index => "measurements-%{+YYYY-MM-dd}"
    }
    stdout {}
}

2月应该是:

measurements-2016-02-01
measurements-2016-02-02
measurements-2016-02-03

相反

0 个答案:

没有答案