Hello
Ho to convert Epoch time stamp to basic date time
my config file looks like below
<source>
type tail
path /var/log/snmptraps.log
read_from_head true
tag snmplog
format multiline
format_firstline /^\</
format1 /(?<time>\d+)(?:,\W)(?<Severity>[^"]+)(?:",\d[\W]+")/
</source>
<match *.**>
type copy
<store>
type elasticsearch
host localhost
port 9200
flush_interval 10s
</store>
</match>
here I 've to conver the 'time' field to basic date time format as it is coming as epoch in log I tried to change my config as below but its not working
<source>
type tail
path /var/log/snmptraps.log
read_from_head true
tag snmplog
format multiline
format_firstline /^\</
format1 /(?<time>\d+)(?:,\W)(?<Severity>[^"]+)(?:",\d[\W]+")/
time_format ${Time.at(time_format).strftime('%Y-%m-%d %H:%M:%S')}
</source>
<match *.**>
type copy
<store>
type elasticsearch
host localhost
port 9200
logstash_format true
flush_interval 10s
</store>
</match>
any help plz?
thanks
Arun