Skip to content

PeerJ/fluent-plugin-common-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fluent-plugin-common-log

Fluent TextFormatter Plugin for the common log format

Sample (using simplier apache2 format, records as http version 1.1)

<source>
  format apache2
</source>

<match *>
  type file
  path /var/log/common_log_example.log
  format common_log
  fields "{:host => 'host', :user => 'user', :method => 'method', :path => 'path', :code => 'code', :size => 'size', :referer => 'referer', :agent => 'agent' }"
</match>

Sample (using custom format, but sets correct http version in logs)

<source>
  format /^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +(?<version>[^\"]*))?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$/
  time_format %d/%b/%Y:%H:%M:%S %z
</source>

<match *>
  type file
  path /var/log/common_log_example.log
  format common_log
  fields "{:host => 'host', :user => 'user', :method => 'method', :path => 'path', :code => 'code', :size => 'size', :referer => 'referer', :agent => 'agent', :version => 'version' }"
</match>

About

Fluent TextFormatter Plugin for the common log format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages