JSON¶
This filter inspects fields in JSON encoded datasets and accepts or rejects messages based on their contents.
Parameters¶
Reject
Defines a list of field names and regular expressions. Messages are rejected if the specified field’s contents matches the given regular expression. Reject is checked before Accept. Field paths can be defined in the format accepted by tgo.MarshalMap.Path. By default this parameter is set to an empty list.
Accept
Defines a list of field names and regular expressions. Messages are accepted if the specified field’s contents matches the given regular expression. Accept is checked after Reject. Field paths can be defined in the format accepted by tgo.MarshalMap.Path. By default this parameter is set to an empty list.
ApplyTo
Defines which part of the message the filter is applied to. When set to “”, this filter is applied to the message’s payload. All other values denotes a metadata key. By default this parameter is set to “”.
Parameters (from core.SimpleFilter)¶
FilteredStream
This value defines the stream filtered messages get sent to. You can disable this behavior by setting the value to “”. By default this parameter is set to “”.
Examples¶
ExampleConsumer:
Type: consumer.Console
Streams: console
Modulators:
- filter.JSON:
Reject:
type: ^log\.
Accept:
source: ^www\d+\.
data/active: true