Outcold Solutions LLC

Monitoring Docker - Version 5

Collector Configuration

The default Configuration file 001-general.conf is mapped to the /config/001-general.conf inside the image. You can override configurations by placing another files in the same folder. The collector reads all the *.conf files in the /config folder in the alphabetical order.

With the configuration files, you can override general settings for how collector behaves, what data it forwards to Splunk, how it should connect to Splunk, and default configurations for data pipelines (logs, metrics). You can also configure data forwarding for the specific containers using annotations attached to these containers, use it to define join-rules for multi-line events, enable removing the terminal colors, redirecting events base on patterns to /dev/null, defining fields extraction, replace patterns in the logs, configuring application logs for the containers.

Overriding configuration by embedding configuration files

You can create your configuration files, which overrides the default values in 001-general.conf. Just place only the values that you want to replace inside this file, for example, create a file 002-conf.conf

# accepting license
[general]
acceptLicense = true

# Configuring Splunk output
[output.splunk]
url = https://hec.example.com:8088/services/collector/event/1.0
token = B5A79AAD-D822-46CC-80D1-819F80D7BFB0
insecure = true

# Overriding default indices
[input.system_stats]
index = docker_stats

[input.mount_stats]
index = docker_stats

[input.net_stats]
index = docker_stats

[input.net_socket_table]
index = docker_stats

[input.proc_stats]
index = docker_stats

[input.files]
index = docker_logs

[input.app_logs]
index = docker_logs

[input.files::syslog]
index = docker_logs

[input.files::logs]
index = docker_logs

[input.docker_events]
index = docker_logs

Create a Dockerfile

FROM outcoldsolutions/collectorfordocker:5.22.420

COPY 002-conf.conf /config/002-conf.conf

Build the image

docker build -t example.com/collectorfordocker:5.22.420 .

Use this image to start the collector with the instructions how we deploy the collector.

Overriding configuration with the environment variables

You can override configurations with the environment variables in format

--env "COLLECTOR__<ANYUNIQUENAME>=<section>__<key>=<value>"

Identical example to the file above

--env "COLLECTOR__ACCEPTLICENSE=general__acceptLicense=true" \
--env "COLLECTOR__SPLUNK_URL=output.splunk__url=https://hec.example.com:8088/services/collector/event/1.0" \
--env "COLLECTOR__SPLUNK_TOKEN=output.splunk__token=B5A79AAD-D822-46CC-80D1-819F80D7BFB0"  \
--env "COLLECTOR__SPLUNK_INSECURE=output.splunk__insecure=true"  \
--env "COLLECTOR__STATS_INDEX=input.system_stats__index=docker_stats" \
--env "COLLECTOR__STATS_INDEX=input.mount_stats__index=docker_stats" \
--env "COLLECTOR__STATS_INDEX=input.net_stats__index=docker_stats" \
--env "COLLECTOR__STATS_INDEX=input.net_socket_table__index=docker_stats" \
--env "COLLECTOR__PROCSTATS_INDEX=input.proc_stats__index=docker_stats" \
--env "COLLECTOR__CONTAINERLOGS_INDEX=input.files__index=docker_logs" \
--env "COLLECTOR__APPLICATIONLOGS_INDEX=input.app_logs__index=docker_logs" \
--env "COLLECTOR__SYSLOG_INDEX=input.files::syslog__index=docker_logs" \
--env "COLLECTOR__HOSTLOGS_INDEX=input.files::logs__index=docker_logs" \
--env "COLLECTOR__EVENTS_INDEX=input.docker_events__index=docker_logs"

Attaching EC2 Metadata

You can include EC2 metadata with the forwarded data (logs and metrics) by specifying desired field name and path from Instance Metadata and User Data.

# Include EC2 Metadata (see list of possible fields https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
# Should be in format ec2Metadata.{desired_field_name} = {url path to read the value}
# ec2Metadata.ec2_instance_id = /latest/meta-data/instance-id
# ec2Metadata.ec2_instance_type = /latest/meta-data/instance-type

As an example, if you configure Collectord with environment variables, you can include EC2 Metadata specific fields with

...
--env "COLLECTOR__EC2_INSTANCE_ID=general__ec2Metadata.ec2_instance_id=/latest/meta-data/instance-id" \
--env "COLLECTOR__EC2_INSTANCE_TYPE=general__ec2Metadata.ec2_instance_type=/latest/meta-data/instance-type" \
...

Placeholders in index and sources

You can apply dynamic index names in the configurations to forward logs or stats to a specific index, based on the meta fields. For example, you can define an index as

[input.files]

index = docker_{{docker_cluster}}

Similarly you can change the source of all the forwarded logs like

[input.files]

source = /{{docker_cluster}}/{{docker_container_name}}

Download 001-general.conf

collector.conf

curl

$ curl -O https://www.outcoldsolutions.com/docs/monitoring-docker/v5/configuration/collector.conf

wget

$ wget https://www.outcoldsolutions.com/docs/monitoring-docker/v5/configuration/collector.conf

Reference 001-general.conf

  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
# collector configuration file
#
# Run collector with flag -conf and specify location of the configuration file.
#
# You can override all the values using environment variables with the format like
#   COLLECTOR__<ANYNAME>=<section>__<key>=<value>
# As an example you can set dataPath in [general] section as
#   COLLECTOR__DATAPATH=general__dataPath=C:\\some\\path\\data.db
# This parameter can be configured using -env-override, set it to empty string to disable this feature

[general]

# Please review license https://www.outcoldsolutions.com/docs/license-agreement/
# and accept license by changing the value to *true*
acceptLicense = false

# location for the database
# is used to store position of the files and internal state
dataPath = ./data/

# log level (trace, debug, info, warn, error, fatal)
logLevel = info

# http server gives access to two endpoints
# /healthz
# /metrics
httpServerBinding =

# telemetry report endpoint, set it to empty string to disable telemetry
telemetryEndpoint = https://license.outcold.solutions/telemetry/

# license check endpoint
licenseEndpoint = https://license.outcold.solutions/license/

# license server through proxy
licenseServerProxyUrl =

# authentication with basic authorization (user:password)
licenseServerProxyBasicAuth =

# license key
license =

# docker daemon hostname is used by default as hostname
# use this configuration to override
hostname =

# Default output for events, logs and metrics
# valid values: splunk and devnull
# Use devnull by default if you don't want to redirect data
defaultOutput = splunk

# Default buffer size for file input
fileInputBufferSize = 256b

# Maximum size of one line the file reader can read
fileInputLineMaxSize = 1mb

# Include custom fields to attach to every event, in example below every event sent to Splunk will hav
# indexed field my_environment=dev. Fields names should match to ^[a-z][_a-z0-9]*$
# Better way to configure that is to specify labels for Docker Hosts.
# ; fields.my_environment = dev

# Include EC2 Metadata (see list of possible fields https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
# Should be in format ec2Metadata.{desired_field_name} = {url path to read the value}
# ec2Metadata.ec2_instance_id = /latest/meta-data/instance-id
# ec2Metadata.ec2_instance_type = /latest/meta-data/instance-type

# subdomain for the annotations added to the pods, workloads, namespaces or containers, like splunk.collectord.io/..
annotationsSubdomain =

# configure global thruput per second for forwarded logs (metrics are not included)
# for example if you set `thruputPerSecond = 512Kb`, that will limit amount of logs forwarded
# from the single Collectord instance to 512Kb per second.
# You can configure thruput individually for the logs (including specific for container logs) below
thruputPerSecond =

# Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
# older than 7 days
tooOldEvents =

# Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
tooNewEvents =


[license.client]
# point to the license located on the HTTP web server, or a hosted by the Collectord running as license server
url =
# basic authentication for the HTTP server
basicAuth =
# if SSL, ignore the certificate verification
insecure = false
# CA Path for the Server certificate
capath =
# CA Name fot the Server certificate
caname =
# license server through proxy
proxyUrl =
# authentication with basic authorization (user:password)
proxyBasicAuth =


# forward internal collectord metrics
[input.collectord_metrics]

# disable collectord internal metrics
disabled = false

# override type
type = docker_prometheus

# how often to collect internal metrics
interval = 1m

# set output (splunk or devnull, default is [general]defaultOutput)
output =

# specify Splunk index
index =

# whitelist or blacklist the metrics
whitelist.1 = ^file_input_open$
whitelist.2 = ^file_input_read_bytes$
whitelist.3 = ^docker_handlers$
whitelist.4 = ^pipe$
whitelist.5 = ^pipelines_num$
whitelist.6 = ^splunk_post_bytes_sum.*$
whitelist.7 = ^splunk_post_events_count_sum.*$
whitelist.8 = ^splunk_post_failed_requests$
whitelist.9 = ^splunk_post_message_max_lag_seconds_bucket.*$
whitelist.10 = ^splunk_post_requests_seconds_sum.*$
whitelist.11 = ^splunk_post_retries_required_sum.*$


# connection to docker host
[general.docker]

# url for docker API, only unix socket is supported
url = unix:///rootfs/var/run/docker.sock

# path to docker root folder (can fallback to use folder structure to read docker metadata)
# used to discovery application logs and collecting mount stats (usage)
dockerRootFolder = /rootfs/var/lib/docker/

# Timeout for http responses to docker client. The streaming requests depend on this timeout.
timeout = 1m

# regex to find docker container cgroups (helps excluding other cgroups with matched ID)
containersCgroupFilter = ^/([^/\s]+/)*(((docker-|docker/|ecs/[a-f0-9\-]{36}/)[0-9a-f]{64}(\.scope)?)|(libpod-[0-9a-f]{64}(\.scope)?/container))$

# api version for internal calls
apiVersion = v1.21

# cgroup input
# sends stas for the host and cgroups (containers)
[input.system_stats]

# disable system level stats
disabled.host = false
disabled.cgroup = false

# cgroups fs location
pathCgroups = /rootfs/sys/fs/cgroup

# proc location
pathProc = /rootfs/proc

# how often to collect cgroup stats
statsInterval = 30s

# override type
type.host = docker_stats_v2_host
type.cgroup = docker_stats_v2_cgroup

# specify Splunk index
index.host =
index.cgroup =

# set output (splunk or devnull, default is [general]defaultOutput)
output.host =
output.cgroup =


# mount input (collects mount stats where docker runtime is stored)
[input.mount_stats]

# disable system level stats
disabled = false

# how often to collect mount stats
statsInterval = 30s

# override type
type = docker_mount_stats

# specify Splunk index
index =

# set output (splunk or devnull, default is [general]defaultOutput)
output =


# diskstats input (collects /proc/diskstats)
[input.disk_stats]

# disable system level stats
disabled = false

# how often to collect mount stats
statsInterval = 30s

# override type
type = docker_disk_stats

# specify Splunk index
index =

# set output (splunk or devnull, default is [general]defaultOutput)
output =


# proc input
[input.proc_stats]

# disable proc level stats
disabled = false

# proc location
pathProc = /rootfs/proc

# how often to collect proc stats
statsInterval = 60s

# override type
type = docker_proc_stats_v2

# specify Splunk index
index.host =
index.cgroup =

# proc filesystem includes by default system threads (there can be over 100 of them)
# these stats do not help with the observability
# excluding them can reduce the size of the index, performance of the searches and usage of the collector
includeSystemThreads = false

# set output (splunk or devnull, default is [general]defaultOutput)
output.host =
output.cgroup =


# network stats
[input.net_stats]

# disable net stats
disabled = false

# proc path location
pathProc = /rootfs/proc

# how often to collect net stats
statsInterval = 30s

# override type
type = docker_net_stats_v2

# specify Splunk index
index =

# set output (splunk or devnull, default is [general]defaultOutput)
output =


# network socket table
[input.net_socket_table]

# disable net stats
disabled = false

# proc path location
pathProc = /rootfs/proc

# how often to collect net stats
statsInterval = 30s

# override type
type = docker_net_socket_table

# specify Splunk index
index =

# set output (splunk or devnull, default is [general]defaultOutput)
output =

# group connections by tcp_state, localAddr, remoteAddr (if localPort is not the port it is listening on)
# that can significally reduces the amount of events
group = true


# Log files
[input.files]

# disable container logs monitoring
disabled = false

# root location of docker log files, expecting that this folder has a folder for each container,
# folder is the containerID
path = /rootfs/var/lib/docker/containers/

# (obsolete, ignored) glob matching pattern for log files
# glob = */*-json.log*

# files are read using polling schema, when reach the EOF how often to check if files got updated
pollingInterval = 250ms

# how often to look for the new files under logs path
walkingInterval = 5s

# include verbose fields in events (file offset)
verboseFields = false

# override type
type = docker_logs

# specify Splunk index
index =

# docker splits events when they are larger than 10-100k (depends on the docker version)
# we join them together by default and forward to Splunk as one event
joinPartialEvents = true

# In case if your containers report messages with terminal colors or other escape sequences
# you can enable strip for all the containers in one place.
# Better is to enable it only for required container with the label collectord.io/strip-terminal-escape-sequences=true
stripTerminalEscapeSequences = false
# Regexp used for stripping terminal colors, it does not stip all the escape sequences
# Read http://man7.org/linux/man-pages/man4/console_codes.4.html for more information
stripTerminalEscapeSequencesRegex = (\x1b\[\d{1,3}(;\d{1,3})*m)|(\x07)|(\x1b]\d+(\s\d)?;[^\x07]+\x07)|(.*\x1b\[K)

# sample output (-1 does not sample, 20 - only 20% of the logs should be forwarded)
samplingPercent = -1

# sampling key for hash based sampling (should be regexp with the named match pattern `key`)
samplingKey =

# set output (splunk or devnull, default is [general]defaultOutput)
output =

# configure default thruput per second for for each container log
# for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
# from the single container to 128Kb per second.
thruputPerSecond =

# Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
# older than 7 days
tooOldEvents =

# Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
tooNewEvents =


# Application Logs
[input.app_logs]

# disable container logs monitoring
disabled = false

# root location of mounts (applies to hostPath mounts only), , if the hostPath differs inside container from the path on host
root = /rootfs

# how often to review list of available volumes
syncInterval = 5s

# glob matching pattern for log files
glob = *.log*

# files are read using polling schema, when reach the EOF how often to check if files got updated
pollingInterval = 250ms

# how often to look for the new files under logs path
walkingInterval = 5s

# include verbose fields in events (file offset)
verboseFields = false

# override type
type = docker_logs

# specify Splunk index
index =

# we split files using new line character, with this configuration you can specify what defines the new event
# after new line
eventPatternRegex = ^[^\s]
# Maximum interval of messages in pipeline
eventPatternMaxInterval = 100ms
# Maximum time to wait for the messages in pipeline
eventPatternMaxWait = 1s
# Maximum message size
eventPatternMaxSize = 100kb

# sample output (-1 does not sample, 20 - only 20% of the logs should be forwarded)
samplingPercent = -1

# sampling key for hash based sampling (should be regexp with the named match pattern `key`)
samplingKey =

# set output (splunk or devnull, default is [general]defaultOutput)
output =

# configure default thruput per second for for each container log
# for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
# from the single container to 128Kb per second.
thruputPerSecond =

# Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
# older than 7 days
tooOldEvents =

# Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
tooNewEvents =

# Configure how long Collectord should keep the file descriptors open for files, that has not been forwarded yet
# When using PVC, and if pipeline is lagging behind, Collectord holding open fd for files, can cause long termination
# of pods, as kubelet cannot unmount the PVC volume from the system
maxHoldAfterClose = 1800s


# Input syslog(.\d+)? files
[input.files::syslog]

# disable host level logs
disabled = false

# root location of log files
path = /rootfs/var/log/

# regex matching pattern
match = ^(syslog|messages)(.\d+)?$

# limit search only on one level
recursive = false

# files are read using polling schema, when reach the EOF how often to check if files got updated
pollingInterval = 250ms

# how often o look for the new files under logs path
walkingInterval = 5s

# include verbose fields in events (file offset)
verboseFields = false

# override type
type = docker_host_logs

# specify Splunk index
index =

# field extraction
extraction = ^(?P<timestamp>[A-Za-z]+\s+\d+\s\d+:\d+:\d+)\s(?P<syslog_hostname>[^\s]+)\s(?P<syslog_component>[^:\[]+)(\[(?P<syslog_pid>\d+)\])?: (.+)$

# timestamp field
timestampField = timestamp

# format for timestamp
# the layout defines the format by showing how the reference time, defined to be `Mon Jan 2 15:04:05 -0700 MST 2006`
timestampFormat = Jan 2 15:04:05

# Adjust date, if month/day aren't set in format
timestampSetMonth = false
timestampSetDay = false

# timestamp location (if not defined by format)
timestampLocation = Local

# sample output (-1 does not sample, 20 - only 20% of the logs should be forwarded)
samplingPercent = -1

# sampling key for hash based sampling (should be regexp with the named match pattern `key`)
samplingKey =

# set output (splunk or devnull, default is [general]defaultOutput)
output =

# configure default thruput per second for for each container log
# for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
# from the single container to 128Kb per second.
thruputPerSecond =

# Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
# older than 7 days
tooOldEvents =

# Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
tooNewEvents =


# Input all *.log(.\d+)? files
[input.files::logs]

# disable host level logs
disabled = false

# root location of log files
path = /rootfs/var/log/

# regex matching pattern
match = ^(([\w\-.]+\.log(.[\d\-]+)?)|(docker))$

# files are read using polling schema, when reach the EOF how often to check if files got updated
pollingInterval = 250ms

# how often o look for the new files under logs path
walkingInterval = 5s

# include verbose fields in events (file offset)
verboseFields = false

# override type
type = docker_host_logs

# specify Splunk index
index =

# field extraction
extraction =

# timestamp field
timestampField =

# format for timestamp
# the layout defines the format by showing how the reference time, defined to be `Mon Jan 2 15:04:05 -0700 MST 2006`
timestampFormat =

# timestamp location (if not defined by format)
timestampLocation =

# sample output (-1 does not sample, 20 - only 20% of the logs should be forwarded)
samplingPercent = -1

# sampling key (should be regexp with the named match pattern `key`)
samplingKey =

# set output (splunk or devnull, default is [general]defaultOutput)
output =

# configure default thruput per second for for each container log
# for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
# from the single container to 128Kb per second.
thruputPerSecond =

# Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
# older than 7 days
tooOldEvents =

# Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
tooNewEvents =


[input.journald]

# disable host level logs
disabled = false

# root location of log files
path.persistent = /rootfs/var/log/journal/
path.volatile = /rootfs/run/log/journal/

# when reach end of journald, how often to pull
pollingInterval = 250ms

# override type
type = docker_host_logs

# specify Splunk index
index =

# sample output (-1 does not sample, 20 - only 20% of the logs should be forwarded)
samplingPercent = -1

# sampling key (should be regexp with the named match pattern `key`)
samplingKey =

# how often to reopen the journald to free old files
reopenInterval = 1h

# set output (splunk or devnull, default is [general]defaultOutput)
output =

# configure default thruput per second for for each container log
# for example if you set `thruputPerSecond = 128Kb`, that will limit amount of logs forwarded
# from the single container to 128Kb per second.
thruputPerSecond =

# Configure events that are too old to be forwarded, for example 168h (7 days) - that will drop all events
# older than 7 days
tooOldEvents =

# Configure events that are too new to be forwarded, for example 1h - that will drop all events that are 1h in future
tooNewEvents =


# Docker input (events)
[input.docker_events]

# disable docker events
disabled = false

# (obsolete) interval to poll for new events in docker
# docker events are streamed in realtime, recreating connections every ~docker.timeout
# eventsPollingInterval = 5s

# override type
type = docker_events

# specify Splunk index
index =

# set output (splunk or devnull, default is [general]defaultOutput)
output =


[input.docker_api::containers]

# disable docker events
disabled = false

path = /containers/json
inspectPath = /containers//json
interval = 5m
query = all=1
apiVersion =

# override type
type = docker_objects

# specify Splunk index
index =

# set output (splunk or devnull, default is [general]defaultOutput)
output =


[input.docker_api::images]

# disable docker events
disabled = false

path = /images/json
inspectPath = /images//json
interval = 5m
query = all=0
apiVersion =

# override type
type = docker_objects

# specify Splunk index
index =

# set output (splunk or devnull, default is [general]defaultOutput)
output =

[input.docker_api::system]

# disable docker events
disabled = false

path = /system/df
listPath.Volumes = Volumes
interval = 5m
apiVersion =

# override type
type = docker_objects

# specify Splunk index
index =

# set output (splunk or devnull, default is [general]defaultOutput)
output =

# Splunk output
[output.splunk]

# Splunk HTTP Event Collector url
url =
# You can specify muiltiple splunk URls with
#
# urls.0 = https://server1:8088/services/collector/event/1.0
# urls.1 = https://server1:8088/services/collector/event/1.0
# urls.2 = https://server1:8088/services/collector/event/1.0
#
# Limitations:
# * The urls cannot have different path.

# Specify how URL should be picked up (in case if multiple is used)
# urlSelection = random|round-robin|random-with-round-robin
# where:
# * random - choose random url on first selection and after each failure (connection or HTTP status code >= 500)
# * round-robin - choose url starting from first one and bump on each failure (connection or HTTP status code >= 500)
# * random-with-round-robin - choose random url on first selection and after that in round-robin on each
#                             failure (connection or HTTP status code >= 500)
urlSelection = random-with-round-robin

# Splunk HTTP Event Collector Token
token =

# Allow invalid SSL server certificate
insecure = false

# Path to CA cerificate
caPath =

# CA Name to verify
caName =

# path for client certificate (if required)
clientCertPath =

# path for client key (if required)
clientKeyPath =

# Events are batched with the maximum size set by batchSize and staying in pipeline for not longer
# than set by frequency
frequency = 5s
batchSize = 768K
# limit by the number of events (0 value has no limit on the number of events)
events = 50

# Splunk through proxy
proxyUrl =

# authentication with basic authorization (user:password)
proxyBasicAuth =

# Splunk acknowledgement url (.../services/collector/ack)
ackUrl =
# You can specify muiltiple splunk URls for ackUrl
#
# ackUrls.0 = https://server1:8088/services/collector/ack
# ackUrls.1 = https://server1:8088/services/collector/ack
# ackUrls.2 = https://server1:8088/services/collector/ack
#
# Make sure that they in the same order as urls for url, to make sure that this Splunk instance will be
# able to acknowledge the payload.
#
# Limitations:
# * The urls cannot have different path.

# Enable index acknowledgment
ackEnabled = false

# Index acknowledgment timeout
ackTimeout = 3m

# Timeout specifies a time limit for requests made by collector.
# The timeout includes connection time, any
# redirects, and reading the response body.
timeout = 30s

# in case when pipeline can post to multiple indexes, we want to avoid posibility of blocking
# all pipelines, because just some events have incorrect index
dedicatedClientPerIndex = true

# (obsolete) in case if some indexes aren't used anymore, how often to destroy the dedicated client
# dedicatedClientCleanPeriod = 24h

# possible values: RedirectToDefault, Drop, Retry
incorrectIndexBehavior = RedirectToDefault

# gzip compression level (nocompression, default, 1...9)
compressionLevel = default

# number of dedicated splunk output threads (to increase throughput above 4k events per second)
threads = 2
# (BETA) Default algorithm between threads is roundrobin, but you can change it to weighted
threadsAlgorithm = weighted

# if you want to exclude some preindexed fields from events
# excludeFields.docker_container_ip = true

# By default if there are no indexes defined on the message, Collectord sends the event without the index, and
# Splunk HTTP Event Collector going to use the default index for the Token. You can change that, and tell Collectord
# to ignore all events that don't have index defined explicitly
; requireExplicitIndex = true

# You can define if you want to truncate messages that are larger than 1M in length (or define your own size, like 256K)
; maximumMessageLength = 1M

# For messages generated from logs, include unique `event_id` in the event
; includeEventID = false

# Dedicated queue size for the output, default is 1024, larger queue sizes will require more memory,
# but will allow to handle more events in case of network issues
queueSize = 1024

# How many digits after the decimal point to keep for timestamps (0-9)
# Defaults to 3 (milliseconds)
# Change to 6 for microseconds
# Change to 9 for nanoseconds
; timestampPrecision = 3

# Pipe to join events (container logs only)
[pipe.join]

# disable joining event
disabled = false

# Maximum interval of messages in pipeline
maxInterval = 100ms

# Maximum time to wait for the messages in pipeline
maxWait = 1s

# Maximum message size
maxSize = 100K

# Default pattern to indicate new message (should start not from space)
patternRegex = ^[^\s]


# (depricated, use container annotations for settings up join rules)
# Define special event join patterns for matched events
# Section consist of [pipe.join::<name>]
# [pipe.join::my_app]
## Set match pattern for the fields
#; matchRegex.docker_container_image = my_app
#; matchRegex.stream = stdout
## All events start from '[<digits>'
#; patternRegex = ^\[\d+

# You can configure global replace rules for the events, which can help to remove sensitive data
# from logs before they are sent to Splunk. Those rules will be applied to all pipelines for container logs, host logs,
# application logs and events.
# In the following example we replace password=TEST with password=********
; [pipe.replace::name]
; patternRegex = (password=)([^\s]+)
; replace = $1********

# Collectord reports if entropy is low
; [diagnostics::node-entropy]
; settings.path = /rootfs/proc/sys/kernel/random/entropy_avail
; settings.interval = 1h
; settings.threshold = 800

# Collectord can report if node reboot is required
[diagnostics::node-reboot-required]
settings.path = /rootfs/var/run/reboot-required*
settings.interval = 1h

# See https://www.kernel.org/doc/Documentation/admin-guide/hw-vuln/index.rst
# And https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu
[diagnostics::cpu-vulnerabilities]
settings.path = /rootfs/sys/devices/system/cpu/vulnerabilities/*
settings.interval = 1h

About Outcold Solutions

Outcold Solutions provides solutions for monitoring Kubernetes, OpenShift and Docker clusters in Splunk Enterprise and Splunk Cloud. We offer certified Splunk applications, which give you insights across all containers environments. We are helping businesses reduce complexity related to logging and monitoring by providing easy-to-use and deploy solutions for Linux and Windows containers. We deliver applications, which help developers monitor their applications and operators to keep their clusters healthy. With the power of Splunk Enterprise and Splunk Cloud, we offer one solution to help you keep all the metrics and logs in one place, allowing you to quickly address complex questions on container performance.