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

#149: add example configs for configuring filebeat #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
168 changes: 168 additions & 0 deletions CONFIGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@

# Template configs

You can add this templates under `filebeat.autodiscover.providers.templates`. Just add this templates to you `sak-ekf` module config and add needed label with value on pod/deployment (kubernetes.labels.logtype). Most of templates are multiline. [More info](https://www.elastic.co/guide/en/beats/filebeat/current/multiline-examples.html)

## Nginx
```
{
"condition.equals" = {
"kubernetes.labels.logtype" = "nginx"
},
"config" = [
{
"module" = "nginx",
"access" = {
"enabled" = true,
"var.paths" = [
"/var/log/nginx/access.log*"
]
},
"error" = {
"enabled" = true,
"var.paths" = [
"/var/log/nginx/error.log*"
]
}
}
]
}
```

## Kafka
```
{
"condition.equals" = {
"kubernetes.labels.logtype" = "kafka"
},
"config" = [
{
"module" = "kafka",
"logs" = {
"enabled" = true,
"var.paths" = [
"/var/log/kafka/*.log*"
]
}
}
]
}
```

## Java
```
{
"condition.equals" = {
"kubernetes.labels.logtype" = "java"
},
"config" = [
{
"type" = "container",
"paths" = [
"/var/log/containers/*-$${data.kubernetes.container.id}.log"
],
"exclude_lines" = [
"^\\s+[\\-`('.|_]"
],
"multiline.type" = "pattern",
"multiline.pattern" = "^[[:space:]]",
"multiline.negate" = false,
"multiline.match" = "after"
}
]

}
```

## Multiline logs with timestamp
```
{
"condition.equals" = {
"kubernetes.labels.logtype" = "multiline_timestamp"
},
"config" = [
{
"type" = "container",
"paths" = [
"/var/log/containers/*-$${data.kubernetes.container.id}.log"
],
"exclude_lines" = [
"^\\s+[\\-`('.|_]"
],
"multiline.pattern" = "^\\[[0-9]{4}-[0-9]{2}-[0-9]{2}"
"multiline.negate" = "true"
"multiline.match" = "after"
}
]
}
```

## Warning logs
```
{
"condition.equals" = {
"kubernetes.labels.logtype" = "warning"
},
"config" = [
{
"type" = "container",
"paths" = [
"/var/log/containers/*-$${data.kubernetes.container.id}.log"
],
"exclude_lines" = [
"^\\s+[\\-`('.|_]"
],
"multiline.pattern" = "^WARN"
"multiline.negate" = "true"
"multiline.match" = "after"
}
]
}
```

## Error logs
```
{
"condition.equals" = {
"kubernetes.labels.logtype" = "error"
},
"config" = [
{
"type" = "container",
"paths" = [
"/var/log/containers/*-$${data.kubernetes.container.id}.log"
],
"exclude_lines" = [
"^\\s+[\\-`('.|_]"
],
"multiline.pattern" = "^ERR"
"multiline.negate" = "true"
"multiline.match" = "after"
}
]
}
```

## Debug logs

```
{
"condition.equals" = {
"kubernetes.labels.logtype" = "debug"
},
"config" = [
{
"type" = "container",
"paths" = [
"/var/log/containers/*-$${data.kubernetes.container.id}.log"
],
"exclude_lines" = [
"^\\s+[\\-`('.|_]"
],
"multiline.pattern" = "(?>DEBUG|DBG)"
"multiline.negate" = "true"
"multiline.match" = "after"
}
]
}
```
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ First, you need to create a Google OAuth Client:
* Click Create
* Copy the Client ID and Client Secret from the ‘OAuth Client’ modal

## Config templates.
Visit our [Config templates](./CONFIGS.md) and find some usable config templates.

## Example how add with module
```
Expand Down