# Can Elastic Agent ingest from logstash?

**URL:** <https://discuss.elastic.co/t/can-elastic-agent-ingest-from-logstash/356105>\
**Category:** Elastic Agent\
**Created:** [March 25, 2024, 3:02pm UTC](https://discuss.elastic.co/t/can-elastic-agent-ingest-from-logstash/356105 "2024-03-25T15:02:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmgeurts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmgeurts/32/95115_2.png) [@dmgeurts](https://discuss.elastic.co/u/dmgeurts)\
**Post date:** [March 25, 2024, 3:02pm UTC](https://discuss.elastic.co/t/can-elastic-agent-ingest-from-logstash/356105/1 "2024-03-25T15:02:38Z")

</div>

I'm trying to ingest data from MongoDB, not database metrics but the data from a collection stored in MongoDB. There's [GitHub - phutchins/logstash-input-mongodb: MongoDB input plugin for Logstash](https://github.com/phutchins/logstash-input-mongodb), but it's a bit outdated and I would prefer to use the Elastic Agent that already runs on the host for shipping data to ES rather than generate a new XPACK API key.

So, I'm looking for either a way for Elastic Agent to natively read data from a MongoDB database/collection or a way for Logstash to output to Elastic Agent.

---

<div class="post-metadata">

**Author:** ![dmgeurts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmgeurts/32/95115_2.png) [@dmgeurts](https://discuss.elastic.co/u/dmgeurts)\
**Post date:** [April 9, 2024, 10:53am UTC](https://discuss.elastic.co/t/can-elastic-agent-ingest-from-logstash/356105/2 "2024-04-09T10:53:47Z")

</div>

I ended up creating a bash script to write data from a MongoDB collection to a file in 'JSON' format. [GitHub - dmgeurts/unifi\_admin\_activity\_logs: Trying to find a way to extract Admin Activity logs from a unifi Controller](https://github.com/dmgeurts/unifi_admin_activity_logs)

I then used Custom Logs in Elastic Agent to read this log file, this has worked well so far.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 7, 2024, 10:54am UTC](https://discuss.elastic.co/t/can-elastic-agent-ingest-from-logstash/356105/3 "2024-05-07T10:54:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
