Hi all !
Simply, is there some method in Logstash news versions to code a variable which can be used in input, filter and output sections ?
if so, how to code it ?
Thanks.
Hi all !
Simply, is there some method in Logstash news versions to code a variable which can be used in input, filter and output sections ?
if so, how to code it ?
Thanks.
Yes.
input {
anypluginname{
... some code...
add_field => {"yourvariable" => "values"}
}
}
Another option is environment variables.
Thanks, but...
in my simple example below, it doesn't quite work!
look at this :
input {
file {
add_field => {"dbfile" => "reffile"}
...
sincedb_path => "D:/db_logstash/%{dbfile}.db"
...
}
}
After logstash exec, the file D:/db_logstash/%{dbfile}.db has been created !?
And not D:/db_logstash/reffile.db, as I wanted!
Maybe a syntax error?
I think this is not support what you want.
Too bad
Thanks for the heads up!
You cannot use a sprintf reference in an input configuration because at the time that the input configuration is compiled and processed there are no events, so there are no fields to reference.
The add_field option only takes effect one the input is configured and starts generating events.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.