How to put data from server to Kinesis Stream

痞子三分冷 提交于 2019-12-04 07:50:40

So it seems you are already using... http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/kinesis/AmazonKinesisClient.html

Specific method you want is as follows.

You need a stream name, record, and stream key. http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/kinesis/model/PutRecordResult.html

But it seems you have all this?

You would then need a program running always tailing your server log file and when ever there is a new line it will push this.

But your data will only sit their for 24 hours. You then need a worker program to consume the data and place it in some other AWS resource.

If you are tailing some files, try Fluentd. http://www.fluentd.org/

Amazon Kinesis has a pretty nice plugin for that. https://github.com/awslabs/aws-fluent-plugin-kinesis

You can use Amazon kinesis agent to monitor on a set of files and they can stream data to kinesis.

http://docs.aws.amazon.com/streams/latest/dev/writing-with-agents.html

If you're trying to ingest log files, please try Fluentd. Fluentd can tail log files continuously, and do data buffering, encryption, compression, and retry.

Fluentd's Kinesis plugin is developed by Amazon Web Services itself.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!