Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Use default format for nginx (Common Log format) #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

javiercr
Copy link

@javiercr javiercr commented Apr 6, 2015

This PR fixes the date parsing for nginx's access log.

According to nginx documentation the default format for its access log is:

log_format combined '$remote_addr - $remote_user [$time_local] '
                    '"$request" $status $body_bytes_sent '
                    '"$http_referer" "$http_user_agent"';

Where $time_local is the local time in the Common Log Format. According to Wikipedia this mean the format is %d/%b/%Y:%H:%M:%S %z.

@awood45
Copy link
Contributor

awood45 commented Apr 6, 2015

Thank you for the contribution Javier.

I'm going to give this a test soon, since the current code setup works. One thing that could help, is there an example of a format that your change will correctly pick up, that does not currently work?

@javiercr
Copy link
Author

javiercr commented Apr 8, 2015

Hi Alex, are you sure the current code setup is picking up the right datetime from the nginx logs? Are you sure the CloudWatch Logs Agent is not falling back to the current datetime for each log event?

Because according to the nginx docs, to me it seems it is not possible that the agent is parsing correctly the default datetime format used by nginx.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants