#Tail and parse arbitrary text/log file
#Add hostname and service_name fields to all events ("records") with a Fluentd tag of backend.application
@type record_transformer
hostname "#{Socket.gethostname}"
service_name ${tag}
# For all events with a tag of backend.application:
# Keep ONLY events where service_name field contains a value matching /backend.application/ AND where message field contains a value matching /Cannot connect to/
# Discard any events where value of hostname field matches /staging/
@type grep
key service_name
pattern /backend.application/
key message
pattern /Cannot connect to/
key hostname
pattern /staging/
#Write events with backend.application tag to New Relic
@type newrelic
api_key