Skip to content

Commit

Permalink
Add pipeline in FB's supported hints (#30212)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9fda7dd)
  • Loading branch information
ChrsMark authored and mergify-bot committed Feb 4, 2022
1 parent 3cec185 commit da331d9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add support for filtering in journald input with `unit`, `kernel`, `identifiers` and `include_matches`. {pull}29294[29294]
- Add new `userAgent` and `beatInfo` template functions for httpjson input {pull}29528[29528]
- threatintel module: Add new Recorded Future integration. {pull}30030[30030]
- Add pipeline in FB's supported hints. {pull}30212[30212]

*Heartbeat*

Expand All @@ -175,7 +176,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add `elasticsearch.cluster.id` field to Beat and Kibana modules. {pull}29577[29577]
- Add `elasticsearch.cluster.id` field to Logstash module. {pull}29625[29625]
- Add `xpack.enabled` support for Enterprise Search module. {pull}29871[29871]
- Add gcp firestore metricset. {pull}29918[29918]
- Add gcp firestore metricset. {pull}29918[29918]
- Remove strict parsing on RabbitMQ module {pull}30090[30090]

*Packetbeat*
Expand Down
9 changes: 9 additions & 0 deletions filebeat/autodiscover/builder/hints/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const (
excludeLines = "exclude_lines"
processors = "processors"
json = "json"
pipeline = "pipeline"
)

// validModuleNames to sanitize user input
Expand Down Expand Up @@ -121,6 +122,10 @@ func (l *logHints) CreateConfig(event bus.Event, options ...ucfg.Option) []*comm
tempCfg.Put(processors, procs)
}

if pip := l.getPipeline(h); len(pip) != 0 {
tempCfg.Put(pipeline, pip)
}

if jsonOpts := l.getJSONOptions(h); len(jsonOpts) != 0 {
tempCfg.Put(json, jsonOpts)
}
Expand Down Expand Up @@ -187,6 +192,10 @@ func (l *logHints) getProcessors(hints common.MapStr) []common.MapStr {
return builder.GetProcessors(hints, l.config.Key)
}

func (l *logHints) getPipeline(hints common.MapStr) string {
return builder.GetHintString(hints, l.config.Key, "pipeline")
}

func (l *logHints) getJSONOptions(hints common.MapStr) common.MapStr {
return builder.GetHintMapStr(hints, l.config.Key, json)
}
Expand Down
10 changes: 10 additions & 0 deletions filebeat/docs/autodiscover-hints.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ co.elastic.logs/processors.dissect.tokenizer: "%{key2} %{key1}"

In the above sample the processor definition tagged with `1` would be executed first.

[float]
===== `co.elastic.logs/pipeline`

Define an ingest pipeline ID to be added to the {beatname_uc} input/module configuration.

[source,yaml]
-----
co.elastic.logs/pipeline: custom-pipeline
-----

[float]
==== Kubernetes

Expand Down

0 comments on commit da331d9

Please sign in to comment.