From 88492e8ec4147cda6fb5cec8b2dfeb8d36e66690 Mon Sep 17 00:00:00 2001 From: Julian Vassev Date: Sat, 28 Apr 2018 02:47:17 -0700 Subject: [PATCH] Include example output for mounted-file in README --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d6638c4..d13d0e94 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ The only allowed `` directive is of type `mounted-file`. It is used to i path /var/log/welcome.log labels msg=welcome, _container=test-container - @type apache2 + @type none ``` @@ -178,11 +178,37 @@ The above configuration would translate at runtime to something similar to this: tag kube.kfo-test.welcome-logger.test-container - @type apache2 + @type none ``` +All logs originating from a file look exactly as all other Kubernetes logs. However, their `stream` field is not set to `stdout` but to the source file: + +```json +{ + "message": "Some message from the welcome-logger pod", + "stream": "/var/log/welcome.log", + "kubernetes": { + "container_name": "test-container", + "host": "ip-11-11-11-11.us-east-2.compute.internal", + "namespace_name": "kfo-test", + "pod_id": "723dd34a-4ac0-11e8-8a81-0a930dd884b0", + "pod_name": "welcome-logger", + "labels": { + "msg": "welcome", + "test-case": "b" + }, + "namespace_labels": {} + }, + "metadata": { + "region": "us-east-2", + "cluster": "legacy", + "env": "staging" + } +} +``` + ### Available plugins `kube-fluentd-operator` aims to be easy to use and flexible. It also favors appending logs to multiple destinations using `` and as such comes with many plugins pre-installed: @@ -243,7 +269,7 @@ Every log event, be it from a pod or a systemd unit, will now have carry this me The config-reloader binary is the one that listens to changes in K8S and generates Fluentd files. It runs as a daemonset and is not intended to interact with directly. The synopsis is useful when trying to understand the Helm chart or jsut hacking. -``` +```txt usage: config-reloader [] Regenerates Fluentd configs based Kubernetes namespace annotations against templates, reloading