![]() ![]() A regular expression to match logging-related labels. Refer to the log tag option documentation for customizing the log tag format.Ĭomma-separated list of keys of labels, which should be included in message, if these labels are specified for container. To configure the splunk driver across the Docker environment, editĭaemon.json with the key, "log-opts": (12 characters of the container ID).The following properties let you configure the splunk logging driver. ![]() With the new Docker driver, we’re making it really easy for customers to combine the power of Splunk with Docker in analyzing their Docker logs.Docker run -log-driver=splunk -log-opt splunk-token=VALUE -log-opt splunk-url=VALUE. Tag has also been changed with the format I specified. Now I’ll send a few more GET requests again and see the result.Īs you can see above, each event now has a dictionary of attrs which contains the labels in the driver configuration (this can also include list of environment variables). tag – changes how my container will be tagged when events are passed to the Splunk Logging Driver.labels – defines which labels to send to the log driver and which will be included in the event payload.label – defines one or more labels for the container.# docker run -publish 80:80 -label type=test -label location=home -log-driver=splunk -log-opt splunk-token=99E16DCD-E064-4D74-BBDA-E88CE902F600 -log-opt splunk-url= -log-opt splunk-insecureskipverify=true -log-opt tag="" -log-opt labels=type,location nginx ![]() I can also configure the Splunk Logging Driver to include more detailed information about the container itself, something which is very useful for analyzing the logs later. I can now add additional configuration to control how Splunk indexes the events, including changing default index, source and sourcetype. Heading over Splunk, I can see the events pouring in real time Now that the container is running, I can send some GET requests nginx to generate some logs output.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |