How to have a boolean based field migrated from MongoDB to Elasticsearch using Logstash?

You will need to edit the mongodb input plugin ruby code in your logstash installation.

it will be in E:\Elasticsearch\logstash-6.5.4\vendor\bundle\jruby\2.3.0\gems\logstash-input-mongodb-0.4.1\lib\logstash\inputs\mongodb.rb

you need to go to line 294 (a blank line) and paste the snippet below into the blank line.

                elsif v.is_a?(TrueClass) || v.is_a?(FalseClass)
                  event.set(k.to_s, v)

With ^ this change you don't need mutate/convert (boolean) on any boolean fields any more.

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