Search code examples
amazon-web-services.net-coreaws-event-bridge

How to retrieve EventDetails in EventBridge?


Using AWS .NET SDK, I tried to put event with EventBridge and then track it with CloudWatch.

How I put event:

using (var eventClient = new AmazonEventBridgeClient(credentials, RegionEndpoint.USEast1))
            {
                PutEventsResponse result = await eventClient.PutEventsAsync( new PutEventsRequest
                { 
                    Entries = new List<PutEventsRequestEntry>
                    {
                        new PutEventsRequestEntry
                        {
                            DetailType = "TestEvent",
                            EventBusName = "default",
                            Source = "mySource",
                            Detail = JsonConvert.SerializeObject(new TestClass{ Message = "myMessage"}),
                            Time = DateTime.UtcNow
                        }
                    }
                });
            }

And what I see in logs

enter image description here

Can somebody explain me, why I don't see the Detail and DetailType I defined? Maybe I do something wrong?

Thank you in advance


Solution

  • Okey, I finally found solution. All, what I need, was to configure input to my rule target enter image description here

    Here I chose Part of the matched event and defined what I want to receive. But, this variant isn't available for CloudWatch Logs Target, so this answer isn't complete at all.