Skip to content

Commit 209d125

Browse files
committed
refactor(flags)!: extract sort-events from options
1 parent 16a2792 commit 209d125

14 files changed

Lines changed: 35 additions & 34 deletions

File tree

deploy/helm/tracee/templates/tracee-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ data:
151151
stack-addresses: {{ .Values.config.output.options.stackAddresses }}
152152
exec-env: {{ .Values.config.output.options.execEnv }}
153153
exec-hash: {{ .Values.config.output.options.execHash }}
154-
sort-events: {{ .Values.config.output.options.sortEvents }}
154+
sort-events: {{ .Values.config.output.sortEvents }}
155155
{{- with .Values.config.output.webhook }}
156156
webhook:
157157
- {{ .name | default "webhook1" }}:

deploy/helm/tracee/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ config:
133133
stackAddresses: false
134134
execEnv: false
135135
execHash: dev-inode
136-
sortEvents: false
136+
sortEvents: false
137137
# uncomment config.output.webhook to enable a single webhook
138138
# to configure multiple webhooks, use the configFile field
139139
# webhook:

deploy/kubernetes/tracee/tracee.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ data:
5959
stack-addresses: false
6060
exec-env: false
6161
exec-hash: dev-inode
62-
sort-events: false
62+
sort-events: false
6363
---
6464
# Source: tracee/templates/role.yaml
6565
apiVersion: rbac.authorization.k8s.io/v1

docs/docs/flags/output.1.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tracee **\-\-output** - Control how and where output is printed
1111

1212
## SYNOPSIS
1313

14-
tracee **\-\-output** destinations.*name*.*field*=*value* | option:{stack-addresses,exec-env,exec-hash[={inode,dev-inode,digest-inode}],parse-arguments,parse-arguments-fds,sort-events}
14+
tracee **\-\-output** destinations.*name*.*field*=*value* | option:{stack-addresses,exec-env,exec-hash[={inode,dev-inode,digest-inode}],parse-arguments,parse-arguments-fds} | sort-events
1515

1616

1717
## DESCRIPTION
@@ -37,7 +37,7 @@ Output destinations are configured using the format: `--output destinations.<nam
3737

3838
### Output Options
3939

40-
- **option:{stack-addresses,exec-env,exec-hash,parse-arguments,parse-arguments-fds,sort-events}**: Augment output according to the given options. Multiple options can be specified, separated by commas.
40+
- **option:{stack-addresses,exec-env,exec-hash,parse-arguments,parse-arguments-fds}**: Augment output according to the given options. Multiple options can be specified, separated by commas.
4141

4242
- **stack-addresses**: Include stack memory addresses for each event.
4343
- **exec-env**: When tracing execve/execveat, show the environment variables that were used for execution.
@@ -48,7 +48,8 @@ Output destinations are configured using the format: `--output destinations.<nam
4848
- **digest-inode**: Most efficient, keys hash to container image digest and inode pair. Requires container enrichment.
4949
- **parse-arguments**: Parse event arguments into human-readable strings instead of raw machine-readable values.
5050
- **parse-arguments-fds**: Enable parse-arguments and enrich file descriptors with file path translation. May cause pipeline slowdowns.
51-
- **sort-events**: Enable sorting events before passing them to output. May decrease overall program efficiency.
51+
52+
- **sort-events**: Enable sorting events before passing them to output. May decrease overall program efficiency.
5253

5354
## EXAMPLES
5455

docs/docs/outputs/output-options.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,12 @@ See the [Sorting Events](./sorting-events.md) documentation for details on how t
107107
**Configuration:**
108108
```yaml
109109
output:
110-
options:
111-
sort-events: true
110+
sort-events: true
112111
```
113112
114113
**CLI:**
115114
```bash
116-
tracee --output option:sort-events
115+
tracee --output sort-events
117116
```
118117

119118
## See Also

docs/docs/outputs/sorting-events.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ The sorting feature sorts incoming events from the BPF programs chronologically
77
Enable event sorting using the `sort-events` option:
88

99
```console
10-
tracee --output option:sort-events
10+
tracee --output sort-events
1111
```
1212

1313
Or in a configuration file:
1414

1515
```yaml
1616
output:
17-
options:
18-
sort-events: true
17+
sort-events: true
1918
```
2019
2120
!!! Information

docs/docs/policies/usage/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ output:
117117
exec-hash: dev-inode
118118
parse-arguments: true
119119
parse-arguments-fds: true
120-
sort-events: true
120+
sort-events: true
121121
destinations:
122122
- name: stdout
123123
format: json

docs/man/output.1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ tracee \f[B]\-\-output\f[R] \- Control how and where output is printed
66
.SS SYNOPSIS
77
tracee \f[B]\-\-output\f[R]
88
destinations.\f[I]name\f[R].\f[I]field\f[R]=\f[I]value\f[R] |
9-
option:{stack\-addresses,exec\-env,exec\-hash[={inode,dev\-inode,digest\-inode}],parse\-arguments,parse\-arguments\-fds,sort\-events}
9+
option:{stack\-addresses,exec\-env,exec\-hash[={inode,dev\-inode,digest\-inode}],parse\-arguments,parse\-arguments\-fds} |
10+
sort\-events
1011
.SS DESCRIPTION
1112
The \f[B]\-\-output\f[R] flag allows you to control how and where the
1213
output is printed using destinations and output options.
@@ -42,7 +43,7 @@ template format
4243
protocol
4344
.SS Output Options
4445
.IP \[bu] 2
45-
\f[B]option:{stack\-addresses,exec\-env,exec\-hash,parse\-arguments,parse\-arguments\-fds,sort\-events}\f[R]:
46+
\f[B]option:{stack\-addresses,exec\-env,exec\-hash,parse\-arguments,parse\-arguments\-fds}\f[R]:
4647
Augment output according to the given options.
4748
Multiple options can be specified, separated by commas.
4849
.RS 2
@@ -81,11 +82,11 @@ strings instead of raw machine\-readable values.
8182
\f[B]parse\-arguments\-fds\f[R]: Enable parse\-arguments and enrich file
8283
descriptors with file path translation.
8384
May cause pipeline slowdowns.
85+
.RE
8486
.IP \[bu] 2
8587
\f[B]sort\-events\f[R]: Enable sorting events before passing them to
8688
output.
8789
May decrease overall program efficiency.
88-
.RE
8990
.SS EXAMPLES
9091
.IP \[bu] 2
9192
To output events as JSON to stdout using a destination named

examples/config/global_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ output:
178178
# exec-hash: dev-inode # Options: none, inode, dev-inode, digest-inode
179179
# parse-arguments: true
180180
# parse-arguments-fds: false
181-
# sort-events: false
181+
# sort-events: false
182182

183183
# Signatures directory for custom signatures
184184
signatures-dir: ""

pkg/cmd/flags/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ output:
269269
- option:exec-hash=dev-inode
270270
- option:parse-arguments
271271
- option:parse-arguments-fds
272-
- option:sort-events
272+
- sort-events
273273
- table:file1
274274
- json:file2
275275
- gotemplate=template1:file3,file4
@@ -282,7 +282,7 @@ output:
282282
"option:exec-hash=dev-inode",
283283
"option:parse-arguments",
284284
"option:parse-arguments-fds",
285-
"option:sort-events",
285+
"sort-events",
286286
"table:file1",
287287
"json:file2",
288288
"gotemplate=template1:file3,file4",

0 commit comments

Comments
 (0)