Haoyuan Ge
Haoyuan Ge

Reputation: 3699

Only collect logs with specific field by fluent-bit

For example, my logs look like:

{
 "fieldA":"logA",
 "foo":"bar"
}

or

{
 "fieldA":"logA",
 "fieldB":"logB"
}

In my case, I only want logs with field "foo" to be collected, while dropping other logs.

Upvotes: 1

Views: 5005

Answers (1)

Haoyuan Ge
Haoyuan Ge

Reputation: 3699

Use grep filter plugin to only include events with foo field:

[FILTER]
    Name   grep
    Match  *
    Regex  foo .*

Upvotes: 0

Related Questions