-
Notifications
You must be signed in to change notification settings - Fork 8
/
config.hcl
125 lines (120 loc) · 3.54 KB
/
config.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
listen {
# port = 9511 # Default is 9511
# address = "0.0.0.0" # Default is "0.0.0.0"
}
consul {
# enable = true # Default is true
# name = "IISLogExporter" # Default is "IISLogExporter"
# address = "http://localhost:8500" # Default is "http://localhost:8500"
# deregister_on_service_stop = true # Default is false
}
metric {
metric_prefix = "iis"
labels = ["app", "method", "status", "uri", "endpoint"]
}
logger {
# output_log_dir = "C:\\logs" # Default is "<exeDirectory>\logs"
# rotate_every_mb = 10 # Default is 10
# number_of_files = 0 # Default is 0
# files_max_age = 0 # Default is 0
}
/*
site "Example1" {
logs_dir = "C:\\example1"
label_rules = [
{
label_name = "app" # Name pointing to label from metric section
fixed_value = "Example1" # This exact value will be set to label
},
{
label_name = "method"
source = "method" # Field name from grok. Label value will be set basing on this field. Default is value of label_name.
rules = [
{
pattern = "copyFromSource" # Exacly copy value from grok field to label
}
]
},
{
label_name = "status"
source = "status"
rules = [
{
pattern = "copyFromSource"
}
]
},
{
label_name = "uri"
source = "uri"
rules = [
{
pattern = "copyFromSource"
}
]
},
{
label_name = "endpoint"
source = "uri"
rules = [
{
pattern = "/example/{someId}/endpoint"
label_value = "exampleEndpoint" # If source matches pattern then label will be set to this value
},
{
pattern = "/help{+path}"
label_value = "anotherExampleEndpoint"
}]
}]
pattern = "%{TIMESTAMP_ISO8601:logtime} %{WORD:sitename} %{NOTSPACE:computername} %{IPORHOST:ip} %{WORD:method} %{NOTSPACE:uri} %{NOTSPACE:query} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:client_ip} %{NOTSPACE:useragent} %{NOTSPACE:referrer} %{IPORHOST:address}(?:\\:%{NUMBER})? %{NUMBER:status} %{NUMBER:substatus} %{NUMBER:win32_status} %{NUMBER:bytes_sent} %{NUMBER:bytes_received} %{NUMBER:time_taken}"
}
site "Example2" {
logs_dir = "C:\\example2"
label_rules = [
{
label_name = "app"
fixed_value = "Example2"
},
{
label_name = "method"
source = "method"
rules = [
{
pattern = "copyFromSource"
}
]
},
{
label_name = "status"
source = "status"
rules = [
{
pattern = "copyFromSource"
}
]
},
{
label_name = "uri"
source = "uri"
rules = [
{
pattern = "copyFromSource"
}
]
},
{
label_name = "endpoint"
source = "uri"
rules = [
{
pattern = "/some/endpoint"
label_value = "someEndpoint"
},
{
pattern = "/another/endpoint/{someId}"
label_value = "anotherEndpoint"
}]
}]
pattern = "%{TIMESTAMP_ISO8601:logtime} %{WORD:sitename} %{NOTSPACE:computername} %{IPORHOST:ip} %{WORD:method} %{NOTSPACE:uri} %{NOTSPACE:query} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:client_ip} %{NOTSPACE:useragent} %{NOTSPACE:referrer} %{IPORHOST:address}(?:\\:%{NUMBER})? %{NUMBER:status} %{NUMBER:substatus} %{NUMBER:win32_status} %{NUMBER:bytes_sent} %{NUMBER:bytes_received} %{NUMBER:time_taken}"
}
*/