How to generate @timestamp in logstash by combining two fields / columns of input csv
csv文件中的数据来自外部来源,如下所示:
1 2 | orderid,OrderDate,BusinessMinute,Quantity,Price 31874,01-01-2013,00:06,2,17.9 |
数据在一列中包含
我正在使用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | input { file { path =>"/root/data/import/Order.csv" start_position =>"beginning" } } filter { csv { columns => ["orderid","OrderDate","BusinessMinute","Quantity","Price"] separator =>"," } } output { elasticsearch { action =>"index" host =>"localhost" index =>"demo" workers => 1 } } |
如何将
使用mutate过滤器将OrderDate和BusinessMinute字段组合为单个(临时)字段,然后使用日期过滤器,如果成功,则将其删除。
1 2 3 4 5 6 7 8 9 10 11 | filter { mutate { add_field => { "timestamp" =>"%{OrderDate} %{BusinessMinute}" } } date { match => ["timestamp","..."] remove_field => ["timestamp"] } } |