Whilst it's a two question post, the answer to either one will fix my single problem, so I only need a response to one of the two questions.
I'm using an app called dynamic-dynamodb do scale our dynamo tables.
The next thing is to get the logs from that into logstash via nxlog, I've done that as well.
The problem is that the date-time format is slightly wrong, it's
2015-02-24 14:55:39,777
instead of (note the T
and the .
):
2015-02-24T14:55:39.777
Frankly speaking, the documentation on how to configure the logging output is kind of.. well it's rubbish.
I was able to work out how to format it as json but I can't work out how to change the date-time format as it stands.
Here's my format (the format string is stored as a heredoc in a hash and then written to the conf as a template in chef):
{
"EventReceivedTime": "%(asctime)s",
"name": "%(name)s",
"level": "%(levelname)s",
"message": "%(message)s",
"type":"dynamic-dynamodb",
"hostname": "#{node['hostname']}",
"enviroment" : "#{node.chef_environment}",
"node_name" : "#{app_name}",
"ipaddress" : "#{node['ipaddress']}"
}
So, since I can't work out how to change the format I thought I'd re-format the date-time string via nxlog (which reads the log in as json) before I push to logstash but I've looked and well, I can't seem to find how to do that either.
So, any help to answer either of the problems would be fantastic.
1) How to re-format the time directly in the logger format
or
2)How to re-format the date-time in nxlog before I push to logstash