Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added azure aks #42

Merged
merged 2 commits into from
Aug 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions plugins/azure_aks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Plugin Info
version: 0.0.1
title: Microsoft Azure AKS
description: Log parser for Microsoft Azure AKS
parameters:
container_logs_path:
label: Container Filter
description: Filter the container logs running in Kubernetes
type: string
default: "/var/log/containers/*.log"

# Set Defaults
{{$container_logs_path := default "/var/log/containers/*.log" .container_logs_path}}

# Pipeline Template
pipeline:
- id: container_input
type: file_input
include:
- {{ $container_logs_path }}
start_at: {{ $start_at }}
labels:
log_type: aks.container
include_file_path: true
output: container_router

- id: container_router
type: router
routes:
- expr: '$labels.file_name != nil and not ($labels.file_name matches "^carbon")'
output: container_json_parser

- id: container_json_parser
type: json_parser
timestamp:
parse_from: time
layout: '%Y-%m-%dT%H:%M:%S.%sZ'
severity:
parse_from: stream
preserve: true
mapping:
error: stderr
info: stdout
output: container_regex_parser

- id: container_regex_parser
type: regex_parser
parse_from: $labels.file_path
regex: '\/var\/log\/containers\/(?P<pod_name>[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?P<namespace>[^_]+)_(?P<container_name>.+)-(?P<container_id>[a-z0-9]{64})\.log'
output: container_metadata

- id: container_metadata
type: k8s_metadata_decorator
output: {{ .output }}