Skip to content

Instantly share code, notes, and snippets.

@asigatchov
Created March 22, 2017 20:10
Show Gist options
  • Save asigatchov/face9b8aa301bdab1f4a5643e17bf53d to your computer and use it in GitHub Desktop.
Save asigatchov/face9b8aa301bdab1f4a5643e17bf53d to your computer and use it in GitHub Desktop.
конфиг файл для heka
[nginx_access_logs]
type = "LogstreamerInput"
splitter = "TokenSplitter"
decoder = "nginx_access_decoder"
log_directory = "/opt/nginx/logs"
file_match = 'access\.log'
[nginx_access_decoder]
type = "SandboxDecoder"
filename = "lua_decoders/nginx_access.lua"
[nginx_access_decoder.config]
log_format = '$scheme://$host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" "$http_via" $request_time'
type = "nginx.access"
[ESJsonEncoder]
index = "nginx-%{%Y.%m.%d}"
es_index_from_timestamp = true
type_name = "%{Type}"
[ElasticSearchOutput]
server = "http://myhost:9200"
username = "user"
password = "secret"
message_matcher = "Type == 'nginx.access'"
encoder = "ESJsonEncoder"
flush_interval = 3000
flush_count = 10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment