# Apache Logs Support
# Apache Access Log
type sudo_tail
tag oms.api.ApacheAccess.time
format apache2
path /usr/local/apache2/logs/access_log /var/log/apache2/access.log /var/log/httpd/access_log /var/log/apache2/access_log
pos_file /var/opt/microsoft/omsagent/state/var_log_apache_access.pos
run_interval 5s
keep_time_key true
# Apache Error Log
type sudo_tail
tag oms.api.ApacheError.time
format apache_error
path /usr/local/apache2/logs/error_log /var/log/apache2/error.log /var/log/httpd/error_log /var/log/apache2/error_log
pos_file /var/opt/microsoft/omsagent/state/var_log_apache_error.pos
run_interval 5s
keep_time_key true
# Filter Plugins
type record_transformer
enable_ruby
ResourceName Apache
ResourceType ${tag.split('.')[2]}
Computer ${OMS::Common.get_hostname}
ResourceId ${OMS::Common.get_hostname}
type record_transformer
enable_ruby
time ${DateTime.parse(record["time"].gsub(/(\d\d\d\d)(\:)/,"\\1 ")).strftime("%FT%H:%M:%S.%3NZ")}
type record_transformer
enable_ruby
time ${DateTime.parse(record["time"]).strftime("%FT%H:%M:%S.%3NZ")}
# Log Output Plugin
type out_oms_api
log_level info
run_in_background false
buffer_chunk_limit 5m
buffer_type file
buffer_path /var/opt/microsoft/omsagent/state/out_oms_api_apache*.buffer
buffer_queue_limit 10
flush_interval 20s
retry_limit 6
retry_wait 30s
max_retry_wait 30m