trigger lambda based on an event in a raw stream

0

I run a 3rd party application ton EC2 that produces a raw stream of its events. I want to trigger a certain action to take place (likely within a lambda) based on a certain event appearing in the stream. How do I do this? Is it a subscription of some sort (like RSS ?) or something else?

已提问 2 年前343 查看次数
2 回答
1

It depends on how you emit the events? Are you using EventBridge? SQS? Kinesis Data Streams? Each one of them have the option to trigger a Lambda function and also include a filter on the events.

profile pictureAWS
专家
Uri
已回答 2 年前
  • The events come out of my 3rd party app, as a stream; It's a URL which resolves to a page of logs that automatically refreshes and updates when new events take place

  • Lambda function can trigger based of the services I listed above, or by calling the Invoke API. If 3rd party app makes calls to an http endpoint with the events, you can enable Lambda function URLs and point the events there. You can also place the Lambda behind an API Gateway and point the app to that endpoint.

0

If your application is writing to syslogs, then there is an open source tool from AirBnB that has a plugin to send syslogs to kinesis - https://medium.com/airbnb-engineering/introducing-syslog-to-aws-kinesis-via-osquery-da4fc19de5ce Once you are able to get the messages into a Kinesis Data Stream, then you can use the Kinesis Data Stream as an event source for Lambda, as Uri suggested above - https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html

You can also look at Logstash. Logstash has an input plugin for Syslogs - https://www.elastic.co/guide/en/logstash/current/plugins-inputs-syslog.html and an output plugin for Kinesis - https://github.com/samcday/logstash-output-kinesis

Disclaimer: I have not tested these open source tools myself so you need to try them out yourself and ensure they work for your use-case. Neither I nor AWS endorse any of these tools in any way.

profile pictureAWS
专家
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则