Skip to content
This repository has been archived by the owner on Jul 20, 2018. It is now read-only.

Add support for multiple nginx servers on the same host #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kwisatz
Copy link

@kwisatz kwisatz commented Mar 20, 2017

See #6

I'm afraid I'll need a little guidance here. I created this by exporting the extracts for the nginx_access_log input. It looks different from the original content-pack json though. Is there another procedure to create content-pack json or has this simply changed over the versions?

@CLAassistant
Copy link

CLAassistant commented Mar 20, 2017

CLA assistant check
All committers have signed the CLA.

@jalogisch jalogisch self-assigned this Mar 28, 2017
@jalogisch
Copy link

Hej @kwisatz I'll look into this.

First thank you for the contribution!

Maybe you want to elaborate why not writing direct in a json format when you need to change the log format.

log_format json escape=json '{ "@timestamp": "$time_iso8601", '
                         '"@fields": { '
                         '"remote_addr": "$remote_addr", '
                         '"remote_user": "$remote_user", '
                         '"body_bytes_sent": "$body_bytes_sent", '
                         '"request_time": "$request_time", '
                         '"status": "$status", '
                         '"request": "$request", '
                         '"request_method": "$request_method", '
                         '"vhost": "$host",'
                         '"http_x_forwarded_for": "$http_x_forwarded_for",'
                         '"http_referrer": "$http_referer", '
                         '"http_user_agent": "$http_user_agent" } }';

Additional the escape=json available for NGINX 1.11.8 and later will make the exploit not easy. And if using JSON Logfile the regex to extract the information are not needed. That should speed up the work with the messages.

Maybe you like to make your modification available as a second option and not overwrite the default content pack that is working for most users.

Additional you might want to add the JSON Information the to README.

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.

3 participants