我正在尝试通用映射csv文件,因此列的顺序无关紧要。我知道怎么做:
input {
file {
path => "/opt/tradertools/omer/omer.csv"
type => "csv"
}
filter {
if [type] == "csv" {
csv{
columns => ["col example 1","col example 2"]
}
output {
stdout { codec => rubydebug }
file {
path => "/var/log/logstash/%{type}OMER.%{+yyyy.MM.dd.HH}"
}
}
但如果我切换csv列顺序,我还需要更改代码......有人有了想法吗?