Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################### Fluentd Conf ##################################
- <source>
- type syslog
- port 5140
- bind 0.0.0.0
- format json
- tag proxy
- </source>
- <match proxy>
- type file
- path /var/log/td-agent/nginx
- </match>
- ########################## Syslog-ng Conf #################################
- Template
- template FluentdFormat { template("<${PRI}> ${ISODATE} ${HOST} ${PROGRAM} ${PID} $MSG");
- template_escape(no);
- };
- source s_nginx {
- file ("/var/log/nginx/proxy_access.log" );
- };
- destination d_fluentd {
- udp("xxx.xxx.xxx.xxx" port(5140) template(FluentdFormat));
- };
- log { source(s_nginx); destination(d_fluentd);};
- ############## Output Nginx #######################################
- {"xfor": "-", "real-ip": "191.22.160.42", "timestamp": "26/Nov/2015:13:47:59 -0200", "request": "GET /api/v3/notification/current HTTP/1.1", "request_time": "0.252", "bytes": "0", "referer": "-", "user_agent": "Dalvik/1.6.0 (Linux; U; Android 4.4.4; SM-G360M Build/KTU84P)", "upstream_time": "0.252", "pipe": ".", "msisdn": "-", "x_call_id": "-", "mip_access_token": "7c7037f0-f0a7-11e2-b778-0800200c9a66", "frontend": "-", "status": "204", "mip_device_id": "c15374e6c62a8555434948483bc9ec3cdd89b712", "mip_app_version_id": "73", "mip_app_version": "4.0.0"}
- ###################### Input fluentd ##############################
- 2015-11-25 21:36:45 +0000 [warn]: pattern not match: " 2015-11-25T19:36:45-02:00 proxy6 {\"xfor\" \"-\", \"real-ip\": \"177.79.20.185\", \"timestamp\": \"25/Nov/2015:19:36:44 -0200\", \"request\": \"GET /api/v2/medias/categories/apps-store-mais-baixados?apiLevel=22&firstResult=10&maxResult=10 HTTP/1.1\", \"request_time\": \"0.278\", \"bytes\": \"40918\", \"referer\": \"-\", \"user_agent\": \"Mozilla/5.0 (Linux; Android 5.1.1; SM-G531BT Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/46.0.2490.76 Mobile Safari/537.36\", \"upstream_time\": \"0.146\", \"pipe\": \".\", \"msisdn\": \"-\", \"x_call_id\": \"-\", \"mip_access_token\": \"b477157-c29d22dc-cce7e51-f9a3a95ee3\", \"frontend\": \"samsungappsclub\", \"status\": \"200\", \"mip_device_id\": \"8fcc7f0535af2952557fa9e80a4126f4b2b08a88\", \"mip_app_version_id\": \"48\", \"mip_app_version\": \"1.0.0\"}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement