Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/dev - aws csm observability using vector.dev #8556

Merged
merged 1 commit into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions tools/dev/readme-vector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AWS Client Side Monitoring


You can use vector.dev to help monitor api calls of policy execution as a side car process


```shell
export AWS_CSM_HOST=localhost:31000
export AWS_CSM_ENABLED=true
```

and run vector with the config file here.
35 changes: 35 additions & 0 deletions tools/dev/vector.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[sources.aws_csm]
type = "socket"
address = "0.0.0.0:31000"
max_length = 102_400
mode = "udp"


[transforms.aws_api_parse]
type = "remap"
inputs = [ "aws_csm" ]
source = """
. = parse_json!(.message)
del(.SessionToken)
# todo: figure out parsing nano seconds for to_timestamp or equiv.
.Timestamp = now()
"""


[transforms.aws_api_filter]
type = "filter"
inputs = ["aws_api_parse"]
condition = '.Type != "ApiCallAttempt" && .Service != "SSO"'


[transforms.aws_console_format]
type = "remap"
inputs = [ "aws_api_filter" ]
source = """
.message = join!(["aws -", downcase!(.ClientId), "->", join!([.Service, ".", .Api])], separator: " ")
"""

[sinks.console]
inputs = ["aws_console_format"]
type = "console"
encoding = "text"