<source>
@type forward
port 24224
</source>
<match fluentd.logs.**>
@type copy
<store>
@type elasticsearch
host localhost
port 9200
index_name fluentd
type_name fluentd
</store>
<store>
@type grepcounter
count_interval 3
input_key response_code
regexp ^5\d\d$
threshold 1
add_tag_prefix error_5xx
</store>
</match>
<match error_5xx.fluentd.logs.**>
# The event that comes here looks like
#{
# "count":1,
# "input_tag":"error_5xx.apache.access",
# "input_tag_last":"access",
# "message":[500]
#}
@type copy
<store>
@type stdout
</store>
<store>
@type mail
host
smtp.gmail.com #This is for Gmail and Google Apps. Any SMTP server should work
password **************
enable_starttls_auto true
subject '[URGENT] NODE APP 5XX ERROR'
message Total 5xx error count: %s\n\nPlease check your nodeapp ASAP
message_out_keys count #The value of 'count' will be substituted into %s above.
</store>
</match>
my event is like:
{
time: moment().format(),
body: req.body || {},
query: req.query,
path: req.path,
method: req.method,
response_code: <the response code>,
bytes: <no_of_bytes>,
response_time: <response_time>
}
How do I send the 'method','path', 'time', in the email body?