fluent / fluent-plugin-mongo

MongoDB input and output plugin for Fluentd
https://docs.fluentd.org/output/mongo
173 stars 61 forks source link

Unknown output plugin 'mongo in kubernetes #118

Closed sathishkumar64 closed 3 years ago

sathishkumar64 commented 5 years ago

Hi,

We are running our application in kubernetes. we want to ship containers logs to mongodb for using fluent. My config file is : <match **> @type mongo log_level info etc......

during creation of fluent we are getting following errors: error="Unknown output plugin 'mongo'. Run 'gem search -rd fluent-plugin' to find plugins". so please tell me how to install plugin in kubernetes.

Regards, Sathish

cosmo0920 commented 5 years ago

Which image do you use in kubernetes? If none of image contains fluent-plugin-mongo, you should create custom Docker image first.

sathishkumar64 commented 5 years ago

Hi @cosmo0920,

I'm using fluentd:v1.3 image. And now i'm not getting error,but my logs are not shipping to mongo.

My Config Map file:

kind: ConfigMap
apiVersion: v1
data:
   forward.input.conf: |-
    <source>
      @type tail     
      path /logs/*.log
      pos_file /tmp/fluentd1.pos 
      tag *
      read_from_head true
      <parse>
         @type json
      </parse>   
    </source>
   output.conf: |-
    <match **>
       @type mongo
       host *****-*****.gcp.mongodb.net  #Atlas mongodb cluster host
       user *****
       password *****
       database coe-*****
       collection ******-collection       
       port 27017     
       capped
       capped_size 1024m      
    </match>
metadata:
  name: fluentd-es-config
  namespace: logging
repeatedly commented 5 years ago

And now i'm not getting error

Does this mean startup log or runtime log?

sathishkumar64 commented 5 years ago

@repeatedly

I need application logs.

cosmo0920 commented 4 years ago

This is because fluent/fluentd image does not install fluent-plugin-mongo. https://github.com/fluent/fluentd-docker-image/blob/master/v1.11/debian/Dockerfile#L25

You must create fluent-plugin-mongo included image first. https://github.com/fluent/fluentd-docker-image#how-to-build-your-own-image

cosmo0920 commented 3 years ago

@operatorequals creates their image to bundle fluent-plugin-mongo and run on kubernetes: https://github.com/fluent/fluent-plugin-mongo/issues/149#issue-732134603 We can use this image.