mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
Trim cluster log tags to pod name and container name
This commit is contained in:
@@ -33,6 +33,9 @@ RUN sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /et
|
||||
# Install the Elasticsearch Fluentd plug-in.
|
||||
RUN /usr/sbin/td-agent-gem install fluent-plugin-elasticsearch
|
||||
|
||||
# Install the record reformer plugin.
|
||||
RUN /usr/sbin/td-agent-gem install fluent-plugin-record-reformer
|
||||
|
||||
# Copy the Fluentd configuration file.
|
||||
COPY td-agent.conf /etc/td-agent/td-agent.conf
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
.PHONY: build push
|
||||
|
||||
IMAGE = fluentd-elasticsearch
|
||||
TAG = 1.4
|
||||
TAG = 1.5
|
||||
|
||||
build:
|
||||
docker build -t gcr.io/google_containers/$(IMAGE):$(TAG) .
|
||||
|
@@ -40,10 +40,16 @@
|
||||
path /varlog/containers/*.log
|
||||
pos_file /varlog/es-containers.log.pos
|
||||
time_format %Y-%m-%dT%H:%M:%S
|
||||
tag kubernetes.*
|
||||
tag reform.*
|
||||
read_from_head true
|
||||
</source>
|
||||
|
||||
<match reform.**>
|
||||
type record_reformer
|
||||
enable_ruby true
|
||||
tag kubernetes.${tag_suffix[3].split('-')[0..-2].join('-')}
|
||||
</match>
|
||||
|
||||
<match kubernetes.**>
|
||||
type elasticsearch
|
||||
log_level info
|
||||
|
Reference in New Issue
Block a user