Skip to content

Instantly share code, notes, and snippets.

View nocode99's full-sized avatar

Byron Kim nocode99

  • New York, NY
View GitHub Profile
@nocode99
nocode99 / README.md
Created July 20, 2017 16:33 — forked from joelthompson/README.md
Vault Auth
@nocode99
nocode99 / datadog-nginx
Created August 31, 2016 21:45 — forked from technovangelist/datadog-nginx
Nginx log parsing with datadog
"""
Thanks to gane5h for the original script. this is a small kludgy tweak to that one.
Custom parser for nginx log suitable for use by Datadog 'dogstreams'.
To use, add to datadog.conf as follows:
dogstreams: [path to ngnix log (e.g: "/var/log/nginx/access.log"]:[path to this python script (e.g "/usr/share/datadog/agent/dogstream/nginx.py")]:[name of parsing method of this file ("parse")]
so, an example line would be:
dogstreams: /var/log/nginx/access.log:/usr/share/datadog/agent/dogstream/nginx.py:parse
Log of nginx should be defined like that:
log_format time_log '$time_local "$request" S=$status $bytes_sent T=$request_time R=$http_x_forwarded_for';
when starting dd-agent, you can find the collector.log and check if the dogstream initialized successfully