Logstash - Configuring Two output plugin

Hi Team,

Currently, I have an output plugin configured as below. I am looking for another output method to send it to mongodb.

     input {
     http {
    	host => "10.199.208.43"
        port => "8080"
    	type => "json"
      }
    }

    filter {
        ruby {
                path => "C:\Users\Administrator\Desktop\TJ_ruby_Script\removeKeys.rb"
    			script_params => { keys => [ "archive_url"] }
        }
    	date { match => [ "[repository][pushed_at]", "ISO8601" ] target => "[repository][pushed_at]" }
    	mutate {
    			lowercase => [ "[repository][name]" ]
    	}		
    }

    output {
      stdout { codec => rubydebug { metadata => true } }
      elasticsearch {
        hosts => "ELK:9200"
        index => "for-%{[repository][name]}-%{[headers][x_github_event]}-%{+YYYY.MM.dd}"
        manage_template => false
      }
    }

Please help me with links or directions where I can have two outputs in same place. One pushing to elasticsearch DB and one to MongoDB.

Regards
TJ

You can add as many output you need as follow
for MongoDB use this plugin

    output {
      stdout { codec => rubydebug { metadata => true } }
      elasticsearch {
        hosts => "ELK:9200"
        index => "for-%{[repository][name]}-%{[headers][x_github_event]}-%{+YYYY.MM.dd}"
        manage_template => false
      }
	 mongodb {
    id => "my_mongodb_plugin_id"
    collection => "xxxx"
    database => "xxxx"
    uri => "mongodb://<USER>:<PASS>@ddddddd.mlab.com:63156/xxxxx"        
    codec => "json"
  }
    }

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