Issue with logstash filter

Hello Everyone,

I am using below command to load mongodb stats to Elasticsearch using logstatsh.

input {
exec {
command => "mongo test_mongo_db_1 --eval 'db.stats()' --quiet"
interval => 7
type => "db.stats"


filter {
json {
source => "message"

output {
elasticsearch {
hosts => ["localhost:9200"]
index => ["mongstats"]


so, this should load only message part right, but its loading everything even the command it's running.
Is it expected?


Have you looked into instead using Metricbeat, which has support for MongoDB data collection?

1 Like

@Christian_Dahlqvist Thanks for your suggestion, I have installed metric beat but there is an existing issue with dbstats and we have a solution too. can you help me apply this changes to existing installation below is the link for the fix.
I could not find the module dir that's mentioned in the fix.

Any help is highly appreciated.


It looks like it has been merged and will be included in Metricbeat 6.0.

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