Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions examples/logging-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ configuration with it. This should produce output like:
Using tenant tenant-gcp-l
Successfully logged user login event.
Successfully logged admin add event.

```

The output "Successfully logged user login event." is printed after successfully sending the login event
to the TSP. Same thing with "Successfully logged admin add event." but for the add event.

If you look in the TSP logs you should see something like:

```bash
{"service":"proxy","message":"Security Event Received","level":"INFO","timestamp":"2021-02-16T17:45:57.968113921+00:00","tenant_id":"tenant-gcp-l","rayid":"0cddK3H_8SPxGr_t"}
{"service":"proxy","message":"{\"iclFields\":{\"dataLabel\":\"PII\",\"requestId\":\"Rq8675309\",\"requestingId\":\"userId1\",\"sourceIp\":\"127.0.0.1\",\"objectId\":\"userId1\",\"event\":\"USER_LOGIN\"},\"customFields\":{\"field2\":\"gumby\",\"field1\":\"gumby\"}}","level":"INFO","timestamp":"2021-02-16T17:45:57.968137530+00:00","tenant_id":"tenant-gcp-l","rayid":"0cddK3H_8SPxGr_t"}
{"service":"proxy","message":"Security Event Received","level":"INFO","timestamp":"2021-02-16T17:45:57.984058493+00:00","tenant_id":"tenant-gcp-l","rayid":"ScNfti6R0JMZlTQ6"}
{"service":"proxy","message":"{\"iclFields\":{\"dataLabel\":\"PII\",\"requestId\":null,\"requestingId\":\"adminId1\",\"sourceIp\":null,\"objectId\":null,\"event\":\"USER_ADD\"},\"customFields\":{}}","level":"INFO","timestamp":"2021-02-16T17:45:57.984083531+00:00","tenant_id":"tenant-gcp-l","rayid":"ScNfti6R0JMZlTQ6"}
{"service":"logdriver","message":"Making request to Stackdriver to write 2 log entries.","level":"INFO","timestamp":"2021-02-16T17:45:58.867370365+00:00","tenant_id":"tenant-gcp-l"}
{"service":"logdriver","message":"Successfully wrote 2 log entries to Stackdriver.","level":"INFO","timestamp":"2021-02-16T17:45:59.047270024+00:00","tenant_id":"tenant-gcp-l"}
```
tenant-security-proxy-1 | {"contexts":"request","level":"INFO","service":"proxy","timestamp":"2026-05-05T17:36:45.634142Z","message":"Security Event Received","name":"request","ray_id":"7kxICOonlsf0Yb_a","tenant_id":"tenant-gcp-l"}
tenant-security-proxy-1 | {"contexts":"request","level":"INFO","service":"proxy","timestamp":"2026-05-05T17:36:45.634169Z","message":"{\"iclFields\":{\"dataLabel\":\"PII\",\"requestId\":\"Rq8675309\",\"requestingId\":\"userId1\",\"sourceIp\":\"127.0.0.1\",\"objectId\":\"userId1\",\"event\":\"USER_LOGIN\"},\"customFields\":{\"field2\":\"gumby\",\"field1\":\"gumby\"}}","name":"request","ray_id":"7kxICOonlsf0Yb_a","tenant_id":"tenant-gcp-l"}
tenant-security-proxy-1 | {"contexts":"request","level":"INFO","service":"proxy","timestamp":"2026-05-05T17:36:45.642246Z","message":"Security Event Received","name":"request","ray_id":"hWR9meUHd3j5_n3Z","tenant_id":"tenant-gcp-l"}
tenant-security-proxy-1 | {"contexts":"request","level":"INFO","service":"proxy","timestamp":"2026-05-05T17:36:45.642269Z","message":"{\"iclFields\":{\"dataLabel\":\"PII\",\"requestId\":null,\"requestingId\":\"adminId1\",\"sourceIp\":null,\"objectId\":null,\"event\":\"USER_ADD\"},\"customFields\":{}}","name":"request","ray_id":"hWR9meUHd3j5_n3Z","tenant_id":"tenant-gcp-l"}
tenant-security-logdriver-1 | {"contexts":"main;batching;tenant","level":"INFO","service":"logdriver","timestamp":"2026-05-05T17:36:47.663634676Z","message":"BATCH: 2 log events received for an unknown tenant. Using a stdout logger for this tenant.","name":"tenant","tenant_id":"tenant-gcp-l"}
tenant-security-logdriver-1 | {"contexts":"main;batching;stdout client;write-entries","level":"INFO","service":"logdriver","timestamp":"2026-05-05T17:36:47.663797301Z","message":"{\"tenantId\":\"tenant-gcp-l\",\"timestamp\":\"2026-05-05T17:36:45.576Z\",\"iclFields\":{\"logdriverRayId\":\"bAZjbUAXfSkTfOwh\",\"event\":\"USER_LOGIN\",\"requestingId\":\"userId1\",\"dataLabel\":\"PII\",\"objectId\":\"userId1\",\"requestId\":\"Rq8675309\",\"sourceIp\":\"127.0.0.1\",\"tspRayId\":\"ray_id\"},\"customFields\":{\"field2\":\"gumby\",\"field1\":\"gumby\"}}","name":"write-entries"}
tenant-security-logdriver-1 | {"contexts":"main;batching;stdout client;write-entries","level":"INFO","service":"logdriver","timestamp":"2026-05-05T17:36:47.663823051Z","message":"{\"tenantId\":\"tenant-gcp-l\",\"timestamp\":\"2026-05-05T17:36:45.640Z\",\"iclFields\":{\"event\":\"USER_ADD\",\"dataLabel\":\"PII\",\"logdriverRayId\":\"wGC7kDMkGf-1l0uo\",\"requestingId\":\"adminId1\",\"tspRayId\":\"ray_id\"},\"customFields\":{}}","name":"write-entries"}
```

This shows the TSP receiving these events, batching them up together, and sending them successfully to Stackdriver (the configured log sink for
`tenant-gcp-l`).
This shows the TSP receiving these events, batching them up together, and sending them successfully to Logdriver. Because this tenant does not have a log sink configured,
the security events will be output to Logdriver's stdout logs.

If you would like to experiment with a different tenant, just do:

Expand Down
Loading