logstash의 MongoDB output 처리

2022. 2. 14. 13:57서버 프로그래밍

MongoDB output용 플러그인 설치하면 된다.

https://pablo-ezequiel.medium.com/logstash-to-mongodb-38726def6270

 

Logstash to MongoDB

I would like to send data from a CSV to a collection in MongoDB (mlab cloud)

pablo-ezequiel.medium.com

그런데, 에러가 발생하여 다음과 같이 조치가 필요했다.

/usr/share/logstash/bin/logstash-plugin install --version=3.1.5 logstash-output-mongodb

https://github.com/logstash-plugins/logstash-output-mongodb/issues/60

 

Failed to sent event with wrong argument numbers · Issue #60 · logstash-plugins/logstash-output-mongodb

I am trying to push some logs to my local MongoDB instance using Logstash with the configuration as follow: output{ mongodb { id => "mongo-aws-cloudtrail" collection => "aws-cl...

github.com

https://www.elastic.co/guide/en/logstash/current/plugins-outputs-mongodb.html#plugins-outputs-mongodb-generateId

 

Mongodb output plugin | Logstash Reference [8.0] | Elastic

Variable substitution in the id field only supports environment variables and does not support the use of values from the secret store.

www.elastic.co

그런데, Elasticsearch에 동기화하는 것과 달리 동일 데이터가 중복으로 계속 쌓이는 문제가 발생한다.

별도의 ETL을 사용해야 하는것이 아닌지 검토해봐야 할 듯

https://github.com/benighted/mongres

 

GitHub - benighted/mongres: Synchronize PostgreSQL and MongoDB using Node.js

Synchronize PostgreSQL and MongoDB using Node.js. Contribute to benighted/mongres development by creating an account on GitHub.

github.com