Skip to content

Commit

Permalink
Add trace-id filter
Browse files Browse the repository at this point in the history
Signed-off-by: Chance Zibolski <chance.zibolski@gmail.com>
  • Loading branch information
chancez authored and gandro committed Oct 13, 2022
1 parent 4b6193d commit e65862c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/observe/flows.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ more.`,
"http-path", ofilter,
`Show only flows which match this HTTP path regular expressions (e.g. "/page/\\d+")`))

filterFlags.Var(filterVar(
"trace-id", ofilter,
"Show only flows which match this trace ID"))

filterFlags.Var(filterVar(
"from-fqdn", ofilter,
`Show all flows originating at the given fully qualified domain name (e.g. "*.cilium.io").`))
Expand Down
5 changes: 5 additions & 0 deletions cmd/observe/flows_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,11 @@ func (of *flowFilter) set(f *filterTracker, name, val string, track bool) error
f.DestinationPort = append(f.DestinationPort, val)
})

case "trace-id":
f.apply(func(f *flowpb.FlowFilter) {
f.TraceId = append(f.TraceId, val)
})

case "verdict":
if wipe {
f.apply(func(f *flowpb.FlowFilter) {
Expand Down

0 comments on commit e65862c

Please sign in to comment.