forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_to_cloudwatch_metrics.yaml
More file actions
53 lines (46 loc) · 1.07 KB
/
file_to_cloudwatch_metrics.yaml
File metadata and controls
53 lines (46 loc) · 1.07 KB
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
# Parsing logs as metrics and sending to CloudWatch
# ------------------------------------------------------------------------------
# WIP
data_dir: "/var/lib/vector"
# Ingest
sources:
file:
type: "file"
include: [ "sample.log" ]
start_at_beginning: true
# Structure and parse the data
transforms:
remap:
inputs: [ "file" ]
type: "remap"
drop_on_error: false
source: |
. |= parse_apache_log!(string!(.message), "common")
# Transform into metrics
log_to_metric:
inputs: [ "remap" ]
type: "log_to_metric"
metrics:
- type: "counter"
increment_by_value: true
field: "bytes_out"
tags:
method: "{{method}}"
status: "{{status}}"
# Output data
sinks:
console_metrics:
inputs: [ "log_to_metric" ]
type: "console"
encoding:
codec: "json"
console_logs:
inputs: [ "remap" ]
type: "console"
encoding:
codec: "json"
cloudwatch:
inputs: [ "log_to_metric" ]
type: "aws_cloudwatch_metrics"
namespace: "vector"
endpoint: "http://localhost:4566"