forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvector.spec.toml
2466 lines (2098 loc) · 51.4 KB
/
vector.spec.toml
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# __ __ __
# \ \ / / / /
# \ V / / /
# \_/ \/
#
# V E C T O R
# Configuration Specification
#
# ------------------------------------------------------------------------------
# Website: https://vector.dev
# Docs: https://docs.vector.dev
# Community: https://vector.dev/community
# ------------------------------------------------------------------------------
# The file contains a full specification for the `vector.toml` configuration
# file. It follows the TOML format and includes all options, types, and
# possible values.
#
# More info on Vector's configuration can be found at:
# https://docs.vector.dev/usage/configuration
# ------------------------------------------------------------------------------
# Global
# ------------------------------------------------------------------------------
# Global options are relevant to Vector as a whole and apply to global behavior.
#
# Documentation: https://docs.vector.dev/usage/configuration
# The directory used for persisting Vector state, such as on-disk buffers, file
# checkpoints, and more. Please make sure the Vector project has write
# permissions to this dir.
#
# * optional
# * no default
data_dir = "/var/lib/vector"
# ------------------------------------------------------------------------------
# Sources
# ------------------------------------------------------------------------------
# Sources specify data sources and are responsible for ingesting data into
# Vector.
#
# Documentation: https://docs.vector.dev/usage/configuration/sources
[sources.file]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "file"
type = "file"
# Array of file patterns to exclude. Globbing is supported. *Takes precedence
# over the `include` option.*
#
# * required
# * no default
exclude = ["/var/log/nginx/access.log"]
# Array of file patterns to include. Globbing is supported.
#
# * required
# * no default
include = ["/var/log/nginx/*.log"]
# The directory used to persist file checkpoint positions. By default, the
# global `data_dir` is used. Please make sure the Vector project has write
# permissions to this dir.
#
# * optional
# * no default
data_dir = "/var/lib/vector"
# Delay between file discovery calls. This controls the interval at which
# Vector searches for files.
#
# * optional
# * default: 1000
# * unit: milliseconds
glob_minimum_cooldown = 1000
# Ignore files with a data modification date that does not exceed this age.
#
# * optional
# * no default
# * unit: seconds
ignore_older = 86400
# The maximum number of a bytes a line can contain before being discarded. This
# protects against malformed lines or tailing incorrect files.
#
# * optional
# * default: 102400
# * unit: bytes
max_line_bytes = 102400
# When present, Vector will aggregate multiple lines into a single event, using
# this pattern as the indicator that the previous lines should be flushed and a
# new event started. The pattern will be matched against entire lines as a
# regular expression, so remember to anchor as appropriate.
#
# * optional
# * no default
message_start_indicator = "^(INFO|ERROR)"
# When `message_start_indicator` is present, this sets the amount of time
# Vector will buffer lines into a single event before flushing, regardless of
# whether or not it has seen a line indicating the start of a new message.
#
# * optional
# * default: 1000
# * unit: milliseconds
multi_line_timeout = 1000
# When `true` Vector will read from the beginning of new files, when `false`
# Vector will only read new data added to the file.
#
# * optional
# * default: false
start_at_beginning = false
#
# Context
#
# The key name added to each event with the full path of the file.
#
# * optional
# * default: "file"
file_key = "file"
# The key name added to each event representing the current host.
#
# * optional
# * default: "host"
host_key = "host"
#
# Fingerprinting
#
[sources.file.fingerprinting]
# Whether to use the content of a file to differentiate it (`checksum`) or the
# storage device and inode (`device_and_inode`). Depending on your log rotation
# strategy, one may be a better fit than the other.
#
# * optional
# * default: "checksum"
# * enum: "checksum" or "device_and_inode"
strategy = "checksum"
strategy = "device_and_inode"
# The number of bytes read off the head of the file to generate a unique
# fingerprint.
#
# * optional
# * default: 256
# * unit: bytes
fingerprint_bytes = 256
# The number of bytes to skip ahead (or ignore) when generating a unique
# fingerprint. This is helpful if all files share a common header.
#
# * optional
# * default: 0
# * unit: bytes
ignored_header_bytes = 0
[sources.journald]
# The component type
#
# * required
# * no default
# * must be: "journald"
type = "journald"
# Include only entries from the current runtime (boot)
#
# * optional
# * default: true
current_runtime_only = true
# Include only entries from the local system
#
# * optional
# * default: true
local_only = true
# The list of units names to monitor. If empty or not present, all units are
# accepted. Unit names lacking a `"."` will have `".service"` appended to make
# them a valid service unit name.
#
# * optional
# * no default
units = ["ntpd", "sysinit.target"]
[sources.kafka]
# The component type
#
# * required
# * no default
# * must be: "kafka"
type = "kafka"
# A comma-separated list of host and port pairs that are the addresses of the
# Kafka brokers in a "bootstrap" Kafka cluster that a Kafka client connects to
# initially to bootstrap itself.
#
# * required
# * no default
bootstrap_servers = "10.14.22.123:9092,10.14.23.332:9092"
# The consumer group name to be used to consume events from Kafka.
#
# * required
# * no default
group_id = "consumer-group-name"
# The Kafka topics names to read events from.
#
# * required
# * no default
topics = ["topic-1", "topic-2", "topic-3"]
# If offsets for consumer group do not exist, set them using this strategy.
# librdkafka documentation for `auto.offset.reset` option for explanation.
#
# * optional
# * no default
auto_offset_reset = "smallest"
auto_offset_reset = "earliest"
auto_offset_reset = "beginning"
auto_offset_reset = "largest"
auto_offset_reset = "latest"
auto_offset_reset = "end"
auto_offset_reset = "error"
# The field name to use for the topic key. If unspecified, the key would not be
# added to the events. If the message has null key, then this field would not
# be added to the event.
#
# * optional
# * no default
key_field = "user_id"
# The Kafka session timeout in milliseconds.
#
# * optional
# * no default
# * unit: milliseconds
session_timeout_ms = 5000
session_timeout_ms = 10000
[sources.statsd]
# The component type
#
# * required
# * no default
# * must be: "statsd"
type = "statsd"
# UDP socket address to bind to.
#
# * required
# * no default
address = "127.0.0.1:8126"
[sources.stdin]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "stdin"
type = "stdin"
# The maxiumum bytes size of a message before it is discarded.
#
# * optional
# * default: 102400
# * unit: bytes
max_length = 102400
#
# Context
#
# The key name added to each event representing the current host.
#
# * optional
# * default: "host"
host_key = "host"
[sources.syslog]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "syslog"
type = "syslog"
# The input mode.
#
# * required
# * no default
# * enum: "tcp", "udp", and "unix"
mode = "tcp"
mode = "udp"
mode = "unix"
# The TCP or UDP address to listen on.
#
# * optional
# * no default
address = "0.0.0.0:9000"
# The maximum bytes size of incoming messages before they are discarded.
#
# * optional
# * default: 102400
# * unit: bytes
max_length = 102400
# The unix socket path. *This should be absolute path.*
#
# * optional
# * no default
path = "/path/to/socket"
#
# Context
#
# The key name added to each event representing the current host.
#
# * optional
# * default: "host"
host_key = "host"
[sources.tcp]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "tcp"
type = "tcp"
# The address to bind the socket to.
#
# * required
# * no default
address = "0.0.0.0:9000"
# The maximum bytes size of incoming messages before they are discarded.
#
# * optional
# * default: 102400
# * unit: bytes
max_length = 102400
# The timeout before a connection is forcefully closed during shutdown.
#
# * optional
# * default: 30
# * unit: seconds
shutdown_timeout_secs = 30
#
# Context
#
# The key name added to each event representing the current host.
#
# * optional
# * default: "host"
host_key = "host"
[sources.udp]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "udp"
type = "udp"
# The address to bind the socket to.
#
# * required
# * no default
address = "0.0.0.0:9000"
# The maximum bytes size of incoming messages before they are discarded.
#
# * optional
# * default: 102400
# * unit: bytes
max_length = 102400
#
# Context
#
# The key name added to each event representing the current host.
#
# * optional
# * default: "host"
host_key = "host"
[sources.vector]
# The component type
#
# * required
# * no default
# * must be: "vector"
type = "vector"
# The TCP address to bind to.
#
# * required
# * no default
address = "0.0.0.0:9000"
# The timeout before a connection is forcefully closed during shutdown.
#
# * optional
# * default: 30
# * unit: seconds
shutdown_timeout_secs = 30
# ------------------------------------------------------------------------------
# Transforms
# ------------------------------------------------------------------------------
# Transforms parse, structure, and enrich events.
#
# Documentation: https://docs.vector.dev/usage/configuration/transforms
[transforms.add_fields]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "add_fields"
type = "add_fields"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
#
# Fields
#
[transforms.add_fields.fields]
# A key/value pair representing the new field to be added. Accepts all
# supported types. Use `.` for adding nested fields.
#
# * required
# * no default
my_string_field = "string value"
my_env_var_field = "${ENV_VAR}"
my_int_field = 1
my_float_field = 1.2
my_bool_field = true
my_timestamp_field = 1979-05-27T00:32:00.999998-07:00
my_nested_fields = {key1 = "value1", key2 = "value2"}
my_list = ["first", "second", "third"]
[transforms.coercer]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "coercer"
type = "coercer"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
#
# Types
#
[transforms.coercer.types]
# A definition of field type conversions. They key is the field name and the
# value is the type. `strftime` specifiers are supported for the `timestamp`
# type.
#
# * required
# * no default
# * enum: "string", "int", "float", "bool", and "timestamp|strftime"
status = "int"
duration = "float"
success = "bool"
timestamp = "timestamp|%s"
timestamp = "timestamp|%+"
timestamp = "timestamp|%F"
timestamp = "timestamp|%a %b %e %T %Y"
[transforms.field_filter]
# The component type
#
# * required
# * no default
# * must be: "field_filter"
type = "field_filter"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# The target field to compare against the `value`.
#
# * required
# * no default
field = "file"
# If the value of the specified `field` matches this value then the event will
# be permitted, otherwise it is dropped.
#
# * required
# * no default
value = "/var/log/nginx.log"
[transforms.grok_parser]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "grok_parser"
type = "grok_parser"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# The Grok pattern
#
# * required
# * no default
pattern = "%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:message}"
# If `true` will drop the `field` after parsing.
#
# * optional
# * default: true
drop_field = true
# The field to execute the `pattern` against. Must be a `string` value.
#
# * optional
# * default: "message"
field = "message"
#
# Types
#
[transforms.grok_parser.types]
# A definition of mapped field types. They key is the field name and the value
# is the type. `strftime` specifiers are supported for the `timestamp` type.
#
# * required
# * no default
# * enum: "string", "int", "float", "bool", and "timestamp|strftime"
status = "int"
duration = "float"
success = "bool"
timestamp = "timestamp|%s"
timestamp = "timestamp|%+"
timestamp = "timestamp|%F"
timestamp = "timestamp|%a %b %e %T %Y"
[transforms.json_parser]
# The component type
#
# * required
# * no default
# * must be: "json_parser"
type = "json_parser"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# If `true` events with invalid JSON will be dropped, otherwise the event will
# be kept and passed through.
#
# * required
# * no default
drop_invalid = true
# The field decode as JSON. Must be a `string` value.
#
# * optional
# * default: "message"
field = "message"
[transforms.log_to_metric]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "log_to_metric"
type = "log_to_metric"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
#
# Metrics
#
[[transforms.log_to_metric.metrics]]
# The metric type.
#
# * required
# * no default
# * enum: "counter", "gauge", "histogram", and "set"
type = "counter"
type = "gauge"
type = "histogram"
type = "set"
# The log field to use as the metric.
#
# * required
# * no default
field = "duration"
# If `true` the metric will be incremented by the `field` value. If `false` the
# metric will be incremented by 1 regardless of the `field` value.
#
# * optional
# * default: false
increment_by_value = false
# The name of the metric. Defaults to `<field>_total` for `counter` and
# `<field>` for `gauge`.
#
# * required
# * no default
name = "duration_total"
[transforms.log_to_metric.metrics.tags]
# Key/value pairs representing the metric tags.
#
# * required
# * no default
host = "${HOSTNAME}"
region = "us-east-1"
status = "{{status}}"
[transforms.lua]
# The component type
#
# * required
# * no default
# * must be: "lua"
type = "lua"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# The inline Lua source to evaluate.
#
# * required
# * no default
source = """
require("script") # a `script.lua` file must be in your `search_dirs`
if event["host"] == nil then
local f = io.popen ("/bin/hostname")
local hostname = f:read("*a") or ""
f:close()
hostname = string.gsub(hostname, "\n$", "")
event["host"] = hostname
end
"""
# A list of directories search when loading a Lua file via the `require`
# function.
#
# * optional
# * no default
search_dirs = ["/etc/vector/lua"]
[transforms.regex_parser]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "regex_parser"
type = "regex_parser"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# The Regular Expression to apply. Do not inlcude the leading or trailing `/`.
#
# * required
# * no default
regex = "^(?P<host>[\\w\\.]+) - (?P<user>[\\w]+) (?P<bytes_in>[\\d]+) \\[(?P<timestamp>.*)\\] \"(?P<method>[\\w]+) (?P<path>.*)\" (?P<status>[\\d]+) (?P<bytes_out>[\\d]+)$"
# If the `field` should be dropped (removed) after parsing.
#
# * optional
# * default: true
drop_field = true
# The field to parse.
#
# * optional
# * default: "message"
field = "message"
#
# Types
#
[transforms.regex_parser.types]
# A definition of mapped field types. They key is the field name and the value
# is the type. `strftime` specifiers are supported for the `timestamp` type.
#
# * required
# * no default
# * enum: "string", "int", "float", "bool", and "timestamp|strftime"
status = "int"
duration = "float"
success = "bool"
timestamp = "timestamp|%s"
timestamp = "timestamp|%+"
timestamp = "timestamp|%F"
timestamp = "timestamp|%a %b %e %T %Y"
[transforms.remove_fields]
# The component type
#
# * required
# * no default
# * must be: "remove_fields"
type = "remove_fields"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# The field names to drop.
#
# * required
# * no default
fields = ["field1", "field2"]
[transforms.sampler]
# The component type
#
# * required
# * no default
# * must be: "sampler"
type = "sampler"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# The maximum number of events allowed per second.
#
# * required
# * no default
rate = 10
# A list of regular expression patterns to exclude events from sampling. If an
# event's `"message"` key matches _any_ of these patterns it will _not_ be
# sampled.
#
# * optional
# * no default
pass_list = ["[error]", "field2"]
[transforms.tokenizer]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "tokenizer"
type = "tokenizer"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# The field names assigned to the resulting tokens, in order.
#
# * required
# * no default
field_names = ["timestamp", "level", "message"]
# If `true` the `field` will be dropped after parsing.
#
# * optional
# * default: true
drop_field = true
# The field to tokenize.
#
# * optional
# * default: "message"
field = "message"
#
# Types
#
[transforms.tokenizer.types]
# A definition of mapped field types. They key is the field name and the value
# is the type. `strftime` specifiers are supported for the `timestamp` type.
#
# * required
# * no default
# * enum: "string", "int", "float", "bool", and "timestamp|strftime"
status = "int"
duration = "float"
success = "bool"
timestamp = "timestamp|%s"
timestamp = "timestamp|%+"
timestamp = "timestamp|%F"
timestamp = "timestamp|%a %b %e %T %Y"
# ------------------------------------------------------------------------------
# Sinks
# ------------------------------------------------------------------------------
# Sinks batch or stream data out of Vector.
#
# Documentation: https://docs.vector.dev/usage/configuration/sinks
[sinks.aws_cloudwatch_logs]
#
# General
#
# The component type
#
# * required
# * no default
# * must be: "aws_cloudwatch_logs"
type = "aws_cloudwatch_logs"
# A list of upstream source or transform IDs. See Config Composition for more
# info.
#
# * required
# * no default
inputs = ["my-source-id"]
# The group name of the target CloudWatch Logs stream.
#
# * required
# * no default
group_name = "{{ file }}"
group_name = "ec2/{{ instance_id }}"
group_name = "group-name"
# The AWS region of the target CloudWatch Logs stream resides.
#
# * required
# * no default
region = "us-east-1"
# The stream name of the target CloudWatch Logs stream.
#
# * required
# * no default
stream_name = "{{ instance_id }}"
stream_name = "%Y-%m-%d"
stream_name = "stream-name"
# Dynamically create a log group if it does not already exist. This will ignore
# `create_missing_stream` directly after creating the group and will create the
# first stream.
#
# * optional
# * default: true
create_missing_group = true
# Dynamically create a log stream if it does not already exist.
#
# * optional
# * default: true
create_missing_stream = true
# Enables/disables the sink healthcheck upon start.
#
# * optional
# * default: true
healthcheck = true
# Custom hostname to send requests to. Useful for testing.
#
# * optional
# * no default
hostname = "127.0.0.0:5000"
#
# Batching
#
# The maximum size of a batch before it is flushed.
#
# * optional
# * default: 1049000
# * unit: bytes
batch_size = 1049000
# The maximum age of a batch before it is flushed.
#
# * optional
# * default: 1
# * unit: seconds
batch_timeout = 1