I want to output the file using current time just like the config below.
output {
file {
path =>"/home/test/%{+YYYYMMdd}/nginx_%{+YYYYMMdd_HH}.log"
}
}
the filename generated use the UTC timezone time, But I want to ouput the filename with my local time zone(Asia/Beijing)
e.g my local current time is "2016-12-23 17:44"
run the config file above, the filename is "nginx_20161223_09.log"
how can I get the filename using my timezone,just like this "nginx_20161223_17.log"???
UTC is used and this isn't configurable. What you can do (although I think it's a mistake) is to use a ruby filter to create a @metadata field containing the date you want and then reference that field in the file output's path configuration.
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.