1
我正在试图用名为“YYYYMMDD.json”的当前日期处理Logstash中的文件。但是我不能在这个配置文件中使用date变量。是否可以在不对日期进行硬编码的情况下执行此操作?如何在logstash配置文件中使用当前日期作为输入文件
input {
file {
path => "/home/ubuntu/YYYYMMDD.json
type => "ip-address"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
json {
source => "message"
}
}
output {
elasticsearch {
hosts => ["IP:Port"]
index => "results"
document_id => "%{ip}"
doc_as_upsert => true
action => "update"
retry_on_conflict => 10
}
}