#example.toml
yangg@yangg-ubuntu:~/heka/config$ cat example.toml
[hekad]
maxprocs = 2
[stat_graph]
type = "SandboxFilter"
filename = "lua_filters/stat_graph.lua"
ticker_interval = 1
preserve_data = true
message_matcher = "Type == 'heka.statmetric'"
[stat_graph.config]
num_rows = 300
secs_per_row = 1
stats = "stats.counters.000000.count stats.counters.000001.count stats.counters.000002.count"
stat_labels = "counter_0 counter_1 counter_2"
preservation_version = 0
# Heka dashboard for internal metrics and time series graphs
[Dashboard]
type = "DashboardOutput"
address = ":4352"
ticker_interval = 5
# Nginx access log reader
[AcmeWebserver]
type = "LogstreamerInput"
log_directory = "/var/log/nginx"
file_match = 'access\.log'
decoder = "CombinedNginxDecoder"
# Nginx access 'combined' log parser
[CombinedNginxDecoder]
type = "SandboxDecoder"
filename = "lua_decoders/nginx_access.lua"
[CombinedNginxDecoder.config]
user_agent_transform = true
user_agent_conditional = true
type = "combined"
log_format = '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"'
# Collection and visualization of the HTTP status codes
[AcmeHTTPStatus]
type = "SandboxFilter"
filename = "lua_filters/http_status.lua"
ticker_interval = 60
preserve_data = true
message_matcher = "Logger == 'AcmeWebserver'"
# rate of change anomaly detection on column 1 (HTTP 200)
[AcmeHTTPStatus.config]
sec_per_row = 60
rows = 1440
anomaly_config = 'roc("HTTP Status", 2, 15, 0, 1.5, true, false) roc("HTTP Status", 4, 15, 0, 1.5, true, false) mww_nonparametric("HTTP Status", 5, 15, 10, 0.8)'
alert_throttle = 300
preservation_version = 0
yangg@yangg-ubuntu:~/heka$ sudo ./bin/hekad -config=./config/example.toml
#fileoutout
yangg@yangg-ubuntu:~$ cat heka/config/20160628/a.toml
[hekad]
maxprocs = 2
[AcmeWebserver]
type = "LogstreamerInput"
log_directory = "/var/log/nginx"
file_match = 'access\.log'
#[TcpOutput]
#type = "TcpOutput"
#address = "127.0.0.1:51401"
#message_matcher = "Logger == 'AcmeWebserver'"
[FileOutput]
type = "FileOutput"
message_matcher = "Logger == 'AcmeWebserver'"
path = "/tmp/hekad-test.log"
perm = "666"
flush_count = 100
flush_operator = "OR"
encoder = "ProtobufEncoder"