forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.metadata.toml
2008 lines (1800 loc) · 63.6 KB
/
.metadata.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
# Metadata
#
# ------------------------------------------------------------------------------
#
# This file contains structured metadata about the Vector project as a whole.
# It is the source of truth used to generate docs, config examples, and more.
# Once changed, please run to sync everything:
#
# make generate
#
# ------------------------------------------------------------------------------
# global
# ------------------------------------------------------------------------------
# The global section represents global configuration options.
[options.data_dir]
type = "string"
examples = ["/var/lib/vector"]
null = true
description = """\
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.\
"""
# ------------------------------------------------------------------------------
# sources.file
# ------------------------------------------------------------------------------
[sources.file]
beta = true
delivery_guarantee = "best_effort"
guides = []
output_types = ["log"]
resources = []
through_description = "one or more local files"
[sources.file.options.data_dir]
type = "string"
examples = ["/var/lib/vector"]
null = true
description = """\
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.\
"""
[sources.file.options.include]
type = "[string]"
examples = [["/var/log/nginx/*.log"]]
null = false
description = """\
Array of file patterns to include. [Globbing](#globbing) is supported.\
"""
[sources.file.options.exclude]
type = "[string]"
examples = [["/var/log/nginx/access.log"]]
null = false
description = """\
Array of file patterns to exclude. [Globbing](#globbing) is supported. \
*Takes precedence over the `include` option.*\
"""
[sources.file.options.file_key]
type = "string"
category = "Context"
default = "file"
null = false
section = "context"
description = """\
The key name added to each event with the full path of the file.\
"""
[sources.file.options.glob_minimum_cooldown]
type = "int"
default = 1000
null = false
unit = "milliseconds"
description = """\
Delay between file discovery calls. This controls the interval at which \
Vector searches for files.\
"""
[sources.file.options.host_key]
name = "host_key"
type = "string"
category = "Context"
default = "host"
null = false
section = "context"
description = """\
The key name added to each event representing the current host.\
"""
[sources.file.options.ignore_older]
type = "int"
examples = [86400]
null = true
unit = "seconds"
description = """\
Ignore files with a data modification date that does not exceed this age.\
"""
[sources.file.options.max_line_bytes]
type = "int"
unit = "bytes"
null = true
default = 102400
description = """\
The maximum number of a bytes a line can contain before being \
discarded. This protects against malformed lines or tailing incorrect \
files.\
"""
[sources.file.options.start_at_beginning]
type = "bool"
null = false
default = false
description = """\
When `true` Vector will read from the beginning of new files, when \
`false` Vector will only read new data added to the file.\
"""
[sources.file.options.fingerprinting]
type = "table"
null = true
description = """\
Configuration for how the file source should identify files.\
"""
[sources.file.options.fingerprinting.options.strategy]
type = "string"
enum = ["checksum", "device_and_inode"]
default = "checksum"
null = true
description = """\
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.\
"""
[sources.file.options.fingerprinting.options.fingerprint_bytes]
type = "int"
default = 256
null = false
unit = "bytes"
relevant_when = {strategy = "checksum"}
description = """\
The number of bytes read off the head of the file to generate a unique \
fingerprint.\
"""
[sources.file.options.fingerprinting.options.ignored_header_bytes]
type = "int"
default = 0
null = false
unit = "bytes"
relevant_when = {strategy = "checksum"}
description = """\
The number of bytes to skip ahead (or ignore) when generating a unique \
fingerprint. This is helpful if all files share a common header.\
"""
[sources.file.options.message_start_indicator]
type = "string"
null = true
examples = ["^(INFO|ERROR)"]
description = """\
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.\
"""
[sources.file.options.multi_line_timeout]
type = "int"
default = 1000
null = true
unit = "milliseconds"
description = """\
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.\
"""
[sources.file.options.max_read_bytes]
type = "int"
default = 2048
null = true
unit = "bytes"
description = """\
An approximate limit on the amount of data read from a single file at a given \
time.\
"""
[sources.file.options.oldest_first]
type = "bool"
default = false
null = true
description = """\
Instead of balancing read capacity fairly across all watched files, prioritize \
draining the oldest files before moving on to read data from younger files.\
"""
# ------------------------------------------------------------------------------
# sources.journald
# ------------------------------------------------------------------------------
[sources.journald]
beta = true
delivery_guarantee = "best_effort"
guides = []
output_types = ["log"]
resources = []
through_description = "log records from journald"
[sources.journald.options.current_runtime_only]
type = "bool"
null = true
default = true
description = "Include only entries from the current runtime (boot)"
[sources.journald.options.data_dir]
type = "string"
examples = ["/var/lib/vector"]
null = true
description = """\
The directory used to persist the journal checkpoint position. By \
default, the global `data_dir` is used. Please make sure the Vector \
project has write permissions to this dir. \
"""
[sources.journald.options.local_only]
type = "bool"
null = true
default = true
description = "Include only entries from the local system"
[sources.journald.options.units]
type = "[string]"
null = true
default = []
examples = [["ntpd", "sysinit.target"]]
description = """\
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.\
"""
# ------------------------------------------------------------------------------
# sources.kafka
# ------------------------------------------------------------------------------
[sources.kafka]
beta = true
delivery_guarantee = "at_least_once"
guides = []
output_types = ["log"]
resources = []
through_description = "Kafka 0.9 or later"
[sources.kafka.options.bootstrap_servers]
type = "string"
examples = ["10.14.22.123:9092,10.14.23.332:9092"]
null = false
description = """\
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.\
"""
[sources.kafka.options.topics]
type = "[string]"
examples = [
["topic-1", "topic-2", "^(prefix1|prefix2)-.+"]
]
null = false
description = """\
The Kafka topics names to read events from. Regex is supported if the topic \
begins with `^`.
"""
[sources.kafka.options.group_id]
type = "string"
examples = ["consumer-group-name"]
null = false
description = """\
The consumer group name to be used to consume events from Kafka.
"""
[sources.kafka.options.key_field]
type = "string"
examples = ["user_id"]
null = true
description = """\
The log field name to use for the topic key. If unspecified, the key would not \
be added to the log event. If the message has null key, then this field would \
not be added to the log event.\
"""
[sources.kafka.options.auto_offset_reset]
type = "string"
examples = ["smallest", "earliest", "beginning", "largest", "latest", "end", "error"]
null = true
default = "largest"
description = """\
If offsets for consumer group do not exist, set them using this strategy. \
[librdkafka documentation](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md) \
for `auto.offset.reset` option for explanation.\
"""
[sources.kafka.options.session_timeout_ms]
type = "int"
examples = [5000, 10000]
null = true
default = 10000
unit = "milliseconds"
description = """\
The Kafka session timeout in milliseconds.
"""
# ------------------------------------------------------------------------------
# sources.statsd
# ------------------------------------------------------------------------------
[sources.statsd]
beta = true
delivery_guarantee = "best_effort"
guides = []
output_types = ["metric"]
resources = []
through_description = "the StatsD UDP protocol"
[sources.statsd.options.address]
type = "string"
null = false
examples = ["127.0.0.1:8126"]
description = "UDP socket address to bind to."
# ------------------------------------------------------------------------------
# sources.stdin
# ------------------------------------------------------------------------------
[sources.stdin]
delivery_guarantee = "at_least_once"
guides = []
output_types = ["log"]
resources = []
through_description = "standard input (STDIN)"
[sources.stdin.options.max_length]
type = "int"
default = 102400
null = true
unit = "bytes"
description = "The maxiumum bytes size of a message before it is discarded."
[sources.stdin.options.host_key]
type = "string"
category = "Context"
null = false
default = "host"
section = "context"
description = """\
The key name added to each event representing the current host.\
"""
# ------------------------------------------------------------------------------
# sources.syslog
# ------------------------------------------------------------------------------
[sources.syslog]
delivery_guarantee = "best_effort"
guides = []
output_types = ["log"]
resources = []
through_description = "the Syslog 5424 protocol"
[sources.syslog.options.address]
type = "string"
examples = ["0.0.0.0:9000"]
null = true
description = "The TCP or UDP address to listen on."
[sources.syslog.options.host_key]
name = "host_key"
type = "string"
category = "Context"
null = false
default = "host"
section = "context"
description = """\
The key name added to each event representing the current host.\
"""
[sources.syslog.options.max_length]
type = "int"
default = 102400
null = true
unit = "bytes"
description = """\
The maximum bytes size of incoming messages before they are discarded.\
"""
[sources.syslog.options.mode]
type = "string"
enum = ["tcp", "udp", "unix"]
null = false
description = "The input mode."
[sources.syslog.options.path]
type = "string"
examples = ["/path/to/socket"]
null = true
relevant_when = {mode = "unix"}
description = """\
The unix socket path. *This should be absolute path.*
"""
# ------------------------------------------------------------------------------
# sources.tcp
# ------------------------------------------------------------------------------
[sources.tcp]
delivery_guarantee = "best_effort"
guides = []
output_types = ["log"]
resources = []
through_description = "the TCP protocol"
[sources.tcp.options.address]
type = "string"
examples = ["0.0.0.0:9000"]
null = false
description = "The address to bind the socket to."
[sources.tcp.options.host_key]
name = "host_key"
type = "string"
category = "Context"
null = false
default = "host"
section = "context"
description = """\
The key name added to each event representing the current host.\
"""
[sources.tcp.options.max_length]
type = "int"
default = 102400
null = true
unit = "bytes"
description = """\
The maximum bytes size of incoming messages before they are discarded.\
"""
[sources.tcp.options.shutdown_timeout_secs]
type = "int"
default = 30
null = false
unit = "seconds"
description = """\
The timeout before a connection is forcefully closed during shutdown.\
"""
# ------------------------------------------------------------------------------
# sources.udp
# ------------------------------------------------------------------------------
[sources.udp]
delivery_guarantee = "best_effort"
guides = []
output_types = ["log"]
resources = []
through_description = "the UDP protocol"
[sources.udp.options.address]
type = "string"
examples = ["0.0.0.0:9000"]
null = false
description = "The address to bind the socket to."
[sources.udp.options.host_key]
name = "host_key"
type = "string"
category = "Context"
null = false
default = "host"
section = "context"
description = """\
The key name added to each event representing the current host.\
"""
[sources.udp.options.max_length]
type = "int"
default = 102400
null = true
unit = "bytes"
description = """\
The maximum bytes size of incoming messages before they are discarded.\
"""
# ------------------------------------------------------------------------------
# sources.vector
# ------------------------------------------------------------------------------
[sources.vector]
beta = true
delivery_guarantee = "best_effort"
guides = []
output_types = ["log", "metric"]
resources = []
through_description = "another upstream Vector instance"
[sources.vector.options.address]
type = "string"
examples = ["0.0.0.0:9000"]
null = false
description = "The TCP address to bind to."
[sources.vector.options.shutdown_timeout_secs]
type = "int"
default = 30
null = false
unit = "seconds"
description = """\
The timeout before a connection is forcefully closed during shutdown.\
"""
# ------------------------------------------------------------------------------
# transforms.add_fields
# ------------------------------------------------------------------------------
[transforms.add_fields]
allow_you_to_description = "add one or more log fields"
function_categories = ["change_fields"]
guides = []
input_types = ["log"]
output_types = ["log"]
resources = []
[transforms.add_fields.options.fields]
type = "table"
null = false
description = """\
A table of key/value pairs representing the keys to be added to the \
event.\
"""
[transforms.add_fields.options.fields.options."*"]
type = "*"
null = false
examples = [
{name = "my_string_field", value = "string value"},
{name = "my_env_var_field", value = "${ENV_VAR}"},
{name = "my_int_field", value = 1},
{name = "my_float_field", value = 1.2},
{name = "my_bool_field", value = true},
{name = "my_timestamp_field", value = 1979-05-27T00:32:00.999999-07:00},
{name = "my_nested_fields", value = {key1 = "value1", key2 = "value2"}},
{name = "my_list", value = ["first", "second", "third"]},
]
description = """\
A key/value pair representing the new log fields to be added. Accepts all \
[supported types][docs.config_value_types]. Use `.` for adding nested fields.\
"""
# ------------------------------------------------------------------------------
# transforms.add_tags
# ------------------------------------------------------------------------------
[transforms.add_tags]
allow_you_to_description = "add one or more metric tags"
function_categories = ["change_tags"]
guides = []
input_types = ["metric"]
output_types = ["metric"]
resources = []
[transforms.add_tags.options.tags]
type = "table"
null = false
description = """\
A table of key/value pairs representing the tags to be added to the \
metric.\
"""
[transforms.add_tags.options.tags.options."*"]
type = "*"
null = false
examples = [
{name = "my_tag", value = "my value"},
{name = "my_env_tag", value = "${ENV_VAR}"},
]
description = """\
A key/value pair representing the new tag to be added.\
"""
# ------------------------------------------------------------------------------
# transforms.coercer
# ------------------------------------------------------------------------------
[transforms.coercer]
allow_you_to_description = "coerce log fields into fixed types"
function_categories = ["coerce"]
guides = []
input_types = ["log"]
output_types = ["log"]
resources = []
[transforms.coercer.options.types]
type = "table"
null = true
description = "Key/Value pairs representing mapped log field types."
[transforms.coercer.options.types.options."*"]
type = "string"
enum = ["string", "int", "float", "bool", "timestamp|strftime"]
examples = [
{name = "status", value = "int"},
{name = "duration", value = "float"},
{name = "success", value = "bool"},
{name = "timestamp", value = "timestamp|%s", comment = "unix"},
{name = "timestamp", value = "timestamp|%+", comment = "iso8601 (date and time)"},
{name = "timestamp", value = "timestamp|%F", comment = "iso8601 (date)"},
{name = "timestamp", value = "timestamp|%a %b %e %T %Y", comment = "custom strftime format"},
]
null = false
description = """\
A definition of log field type conversions. They key is the log field name and \
the value is the type. [`strftime` specifiers][url.strftime_specifiers] are \
supported for the `timestamp` type.\
"""
# ------------------------------------------------------------------------------
# transforms.field_filter
# ------------------------------------------------------------------------------
[transforms.field_filter]
allow_you_to_description = "filter events by a log field's value"
beta = true
function_categories = ["filter"]
guides = []
input_types = ["log", "metric"]
output_types = ["log", "metric"]
resources = []
[transforms.field_filter.options.field]
type = "string"
examples = ["file"]
null = false
description = "The target log field to compare against the `value`."
[transforms.field_filter.options.value]
type = "string"
examples = ["/var/log/nginx.log"]
null = false
description = """\
If the value of the specified `field` matches this value then the event \
will be permitted, otherwise it is dropped.\
"""
# ------------------------------------------------------------------------------
# transforms.grok_parser
# ------------------------------------------------------------------------------
[transforms.grok_parser]
allow_you_to_description = "parse a log field value with [Grok][url.grok]"
function_categories = ["parse"]
guides = []
input_types = ["log"]
output_types = ["log"]
resources = [
{name = "Grok Debugger", short_link = "grok_debugger"},
{name = "Grok Patterns", short_link = "grok_patterns"}
]
[transforms.grok_parser.options.drop_field]
type = "bool"
default = true
null = false
description = """\
If `true` will drop the specified `field` after parsing.\
"""
[transforms.grok_parser.options.field]
type = "string"
default = "message"
null = false
description = """\
The log field to execute the `pattern` against. Must be a `string` value.\
"""
[transforms.grok_parser.options.pattern]
type = "string"
examples = ["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:message}"]
null = false
description = "The [Grok pattern][url.grok_patterns]"
[transforms.grok_parser.options.types]
type = "table"
null = true
description = "Key/Value pairs representing mapped log field types."
[transforms.grok_parser.options.types.options."*"]
type = "string"
enum = ["string", "int", "float", "bool", "timestamp|strftime"]
examples = [
{name = "status", value = "int"},
{name = "duration", value = "float"},
{name = "success", value = "bool"},
{name = "timestamp", value = "timestamp|%s", comment = "unix"},
{name = "timestamp", value = "timestamp|%+", comment = "iso8601 (date and time)"},
{name = "timestamp", value = "timestamp|%F", comment = "iso8601 (date)"},
{name = "timestamp", value = "timestamp|%a %b %e %T %Y", comment = "custom strftime format"},
]
null = false
description = """\
A definition of mapped log field types. They key is the log field name and \
the value is the type. [`strftime` specifiers][url.strftime_specifiers] are \
supported for the `timestamp` type.\
"""
# ------------------------------------------------------------------------------
# transforms.json_parser
# ------------------------------------------------------------------------------
[transforms.json_parser]
allow_you_to_description = "parse a log field value as JSON"
function_categories = ["parse_json"]
guides = []
input_types = ["log"]
output_types = ["log"]
resources = []
[transforms.json_parser.options.drop_invalid]
type = "bool"
examples = [true]
null = false
description = """\
If `true` events with invalid JSON will be dropped, otherwise the \
event will be kept and passed through.\
"""
[transforms.json_parser.options.field]
type = "string"
default = "message"
null = false
description = """\
The log field to decode as JSON. Must be a `string` value type.\
"""
# ------------------------------------------------------------------------------
# transforms.log_to_metric
# ------------------------------------------------------------------------------
[transforms.log_to_metric]
allow_you_to_description = "convert logs into one or more metrics"
function_categories = ["convert_types"]
guides = []
input_types = ["log"]
output_types = ["metric"]
resources = []
[transforms.log_to_metric.options.metrics]
type = "[table]"
null = false
description = """\
A table of key/value pairs representing the keys to be added to the \
event.\
"""
[transforms.log_to_metric.options.metrics.options.type]
type = "string"
enum = ["counter", "gauge", "histogram", "set"]
null = false
description = "The metric type."
[transforms.log_to_metric.options.metrics.options.field]
type = "string"
examples = ["duration"]
null = false
description = "The log field to use as the metric."
[transforms.log_to_metric.options.metrics.options.increment_by_value]
type = "bool"
default = false
null = false
relevant_when = {type = "counter"}
description = """\
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.\
"""
[transforms.log_to_metric.options.metrics.options.name]
type = "string"
examples = ["duration_total"]
null = false
description = """\
The name of the metric. Defaults to `<field>_total` for `counter` and \
`<field>` for `gauge`.\
"""
[transforms.log_to_metric.options.metrics.options.tags]
type = "table"
display = "inline"
null = true
description = "Key/value pairs representing metric tags."
[transforms.log_to_metric.options.metrics.options.tags.options."*"]
type = "string"
examples = [
{name = "host", value = "${HOSTNAME}"},
{name = "region", value = "us-east-1"},
{name = "status", value = "{{status}}"},
]
null = false
description = "Key/value pairs representing the metric tags."
# ------------------------------------------------------------------------------
# transforms.lua
# ------------------------------------------------------------------------------
[transforms.lua]
allow_you_to_description = "transform events with a full embedded [Lua][url.lua] engine"
beta = true
function_categories = ["program"]
guides = []
input_types = ["log"]
output_types = ["log"]
resources = [
{name = "Lua Reference Manual", short_link = "lua_manual"}
]
[transforms.lua.options.source]
type = "string"
examples = [
"""\
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\
"""
]
null = false
description = "The inline Lua source to evaluate."
[transforms.lua.options.search_dirs]
type = "[string]"
examples = [["/etc/vector/lua"]]
null = true
description = """\
A list of directories search when loading a Lua file via the `require` \
function.\
"""
# ------------------------------------------------------------------------------
# transforms.regex_parser
# ------------------------------------------------------------------------------
[transforms.regex_parser]
allow_you_to_description = """\
parse a log field's value with a [Regular Expression][url.regex]\
"""
function_categories = ["parse"]
guides = []
input_types = ["log"]
output_types = ["log"]
resources = []
[transforms.regex_parser.options.drop_field]
type = "bool"
default = true
null = false
description = "If the specified `field` should be dropped (removed) after parsing."
[transforms.regex_parser.options.field]
type = "string"
default = "message"
null = false
description = "The log field to parse."
[transforms.regex_parser.options.regex]
type = "string"
examples = [
"""\
^(?P<host>[\\w\\.]+) - (?P<user>[\\w]+) (?P<bytes_in>[\\d]+) \\[(?P<timestamp>.*)\\] "(?P<method>[\\w]+) (?P<path>.*)" (?P<status>[\\d]+) (?P<bytes_out>[\\d]+)$\
"""
]
null = false
description = """\
The Regular Expression to apply. Do not inlcude the leading or trailing `/`.\
"""
[transforms.regex_parser.options.types]
type = "table"
null = true
description = "Key/Value pairs representing mapped log field types."
[transforms.regex_parser.options.types.options."*"]
type = "string"
enum = ["string", "int", "float", "bool", "timestamp|strftime"]
examples = [
{name = "status", value = "int"},
{name = "duration", value = "float"},
{name = "success", value = "bool"},
{name = "timestamp", value = "timestamp|%s", comment = "unix"},
{name = "timestamp", value = "timestamp|%+", comment = "iso8601 (date and time)"},
{name = "timestamp", value = "timestamp|%F", comment = "iso8601 (date)"},
{name = "timestamp", value = "timestamp|%a %b %e %T %Y", comment = "custom strftime format"},
]
null = false
description = """\
A definition of mapped log field types. They key is the log field name and \
the value is the type. [`strftime` specifiers][url.strftime_specifiers] are \
supported for the `timestamp` type.\
"""
[[transforms.regex_parser.resources]]
name = "Regex Tester"
short_link = "regex_tester"
[[transforms.regex_parser.resources]]
name = "Rust Regex Syntax"
short_link = "rust_regex_syntax"
# ------------------------------------------------------------------------------
# transforms.remove_fields
# ------------------------------------------------------------------------------
[transforms.remove_fields]
allow_you_to_description = "remove one or more log fields"
function_categories = ["change_fields"]
input_types = ["log"]
output_types = ["log"]
[transforms.remove_fields.options.fields]
type = "[string]"
examples = [["field1", "field2"]]
null = false
description = "The log field names to drop."
# ------------------------------------------------------------------------------
# transforms.remove_tags
# ------------------------------------------------------------------------------
[transforms.remove_tags]
allow_you_to_description = "remove one or more metric tags"
function_categories = ["change_tags"]
input_types = ["metric"]
output_types = ["metric"]
[transforms.remove_tags.options.tags]
type = "[string]"
examples = [["tag1", "tag2"]]
null = false
description = "The tag names to drop."
# ------------------------------------------------------------------------------
# transforms.sampler
# ------------------------------------------------------------------------------
[transforms.sampler]
allow_you_to_description = "sample events with a configurable rate"
beta = true
function_categories = ["sample"]
input_types = ["log"]
output_types = ["log"]
[transforms.sampler.options.pass_list]
type = "[string]"
examples = [["[error]", "field2"]]
null = true
description = """\
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.\
"""
[transforms.sampler.options.rate]
type = "int"
examples = [10]
null = false
description = """\
The rate at which events will be forwarded, expressed as 1/N. For example, \
`rate = 10` means 1 out of every 10 events will be forwarded and the rest \
will be dropped.\
"""
## TODO: Add regex synax docs?
# ------------------------------------------------------------------------------
# transforms.split
# ------------------------------------------------------------------------------
[transforms.split]
allow_you_to_description = """\
split a field's value on a given separator \
and zip the tokens into ordered field names\
"""
function_categories = ["parse"]
input_types = ["log"]
output_types = ["log"]
[transforms.split.options.field]
type = "string"
default = "message"
null = false
description = "The field to apply the split on."