Last active
June 29, 2017 10:02
-
-
Save codeb2cc/149e70cb845cc364004c7f2ed085eabf to your computer and use it in GitHub Desktop.
Kubernetes log pattern for Logstash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DNS_LABEL [a-z0-9]([-a-z0-9]*[a-z0-9])? | |
DNS_SUBDOMAIN %{DNS_LABEL}(\.%{DNS_LABEL})* | |
POD_NAME %{DNS_SUBDOMAIN} | |
NAMESPACE %{DNS_SUBDOMAIN} | |
CONTAINER_NAME %{DNS_LABEL} | |
DOCKER_ID [a-z0-9]{64} | |
DEPLOYMENT_NAME %{DNS_SUBDOMAIN} | |
TEMPLATE_HASH [0-9]{1,10} | |
K8SLOGNAME ^\/var\/log\/containers\/%{POD_NAME:pod}_%{NAMESPACE:namespace}_%{CONTAINER_NAME:container_name}-%{DOCKER_ID:docker_id}\.log$ | |
K8SPODNAME ^%{DEPLOYMENT_NAME:deployment}-%{TEMPLATE_HASH:template_hash}-[0-9a-z]{5}$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment