Skip to content

Commit

Permalink
tools/dev - aws csm observability using vector.dev (#8556)
Browse files Browse the repository at this point in the history
  • Loading branch information
kapilt committed May 16, 2023
1 parent 6ec2112 commit d4ca67a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
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"

0 comments on commit d4ca67a

Please sign in to comment.