Skip to content

Commit

Permalink
[Packetbeat] Fix data stream name for network flows under Agent (#28408)
Browse files Browse the repository at this point in the history
* Fix data stream name for network flows under Agent

This fixes and issue with network flows being written to the wrong
index when using the Network Packet Capture integration in Fleet.

The error was:
    {"type:"security_exception", "reason":"action [indices:admin/auto_create] is unauthorized for API key id [xxx] of user [elastic/fleet-server] on indices [logs-network_traffic.flow-default-2021.10.13] …"}

The cause is that flows were setting `index` rather than `raw_index`. With
`index` Beats adds the date suffix, but since this is a data stream we
want `raw_index` where the value passes through as-is.
  • Loading branch information
andrewkroh authored Oct 15, 2021
1 parent cc7239a commit 5c92897
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ for a few releases. Please use other tools provided by Elastic to fetch data fro
*Packetbeat*

- Handle truncated DNS records more gracefully. {issue}21495[21495] {pull}28297[28297]
- Fix data stream name for network flows when running under Elastic Agent and Fleet. {pull}28408[28408]

*Winlogbeat*

Expand Down
2 changes: 1 addition & 1 deletion packetbeat/beater/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func setupFlows(pipeline beat.Pipeline, watcher procs.ProcessesWatcher, cfg conf
},
}
if cfg.Flows.Index != "" {
clientConfig.Processing.Meta = common.MapStr{"index": cfg.Flows.Index}
clientConfig.Processing.Meta = common.MapStr{"raw_index": cfg.Flows.Index}
}

client, err := pipeline.ConnectWith(clientConfig)
Expand Down

0 comments on commit 5c92897

Please sign in to comment.