Using grok I want to parse a log file as you normally would but i also want to pull a specific piece of of the log record in a custom field. I have 2 patterns one is a nginx_combined with a x-forwarded field at the end. The second is the specific piece of the log that i'm trying to put into it own field. ? (?i)((http[s]?)(://.+?)/)
I've tried this but it isn't creating the custom field.
grok {
patterns_dir => ["/etc/logstash/patterns"]
break_on_match => false
match => { "message" => "%{SED_NGINX_COMBINE}" }
match => { "message" => "%{SED_HTTPHOST:httphost}" }
add_tag => ["drupal-staging"]
}
Basically I want both patterns to exist in a single record in elasticsearch. I first though that an addfield would work but is was suggested that i try it this way. Any ideas ?