Input { file { Path = = ['/gwlog/data/**/*.json '] discover_interval = 1ignore_older = 5 Start_position = "Beginning" Close_older = 6 max_open_files = 200000 codec = JSON }} Filter { Mutate { Remove_field = ["@version", "host", "path"] }}output { MongoDB { codec = > JSON collection = "Tst_log" database "Runlog" uri "=" Mongodb://linge:[email Protected]:8021/admin " } stdout{ codec = JSON }}
If you delete @timestamp, insert data will be error, feel is inserted when the use of @timestamp
2017-09-24t06:15:33,311][warn][logstash.outputs.mongodb] Failed to send event to MongoDB {: Event=>%{host}%{message },: Exception=>java.io.ioexception:fails,: backtrace=>["Org.logstash.Event.getTimestamp (event.java:119)", " Org.logstash.ext.jrubyeventextlibrary$rubyevent.ruby_timestamp (jrubyeventextlibrary.java:290) "," Org.logstash.ext.jrubyeventextlibrary$rubyevent$invoker$i$0$0$ruby_timestamp.call (JrubyEventExtLibrary$ Rubyevent$invoker$i$0$0$ruby_timestamp.gen) "," Org.jruby.runtime.callsite.CachingCallSite.call ( cachingcallsite.java:134) "," Org.jruby.ast.CallNoArgNode.interpret (callnoargnode.java:60) "," Org.jruby.ast.CallNoArgNode.interpret (callnoargnode.java:60) "," Org.jruby.ast.AttrAssignTwoArgNode.interpret ( attrassigntwoargnode.java:36) "," Org.jruby.ast.NewlineNode.interpret (newlinenode.java:105) "," Org.jruby.ast.IfNode.interpret (ifnode.java:116) "," Org.jruby.ast.NewlineNode.interpret (newlinenode.java:105) "," Org.jruby.ast.BlockNode.interpret (blocknode.java:71) "," Org.jruBy.ast.RescueNode.executeBody (rescuenode.java:221) "," Org.jruby.ast.RescueNode.interpret (rescuenode.java:116) ", "Org.jruby.ast.BeginNode.interpret (beginnode.java:83)", "Org.jruby.ast.NewlineNode.interpret (Newlinenode.java : "," Org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD (astinterpreter.java:74) "," Org.jruby.internal.runtime.methods.InterpretedMethod.call (interpretedmethod.java:182) "," Org.jruby.internal.runtime.methods.DefaultMethod.call (defaultmethod.java:203) "," Org.jruby.runtime.callsite.CachingCallSite.cacheAndCall (cachingcallsite.java:326) "," Org.jruby.runtime.callsite.CachingCallSite.call (cachingcallsite.java:170) "," Org.jruby.ast.FCallOneArgNode.interpret (fcalloneargnode.java:36) "," Org.jruby.ast.NewlineNode.interpret ( newlinenode.java:105) "," Org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK (astinterpreter.java:112) "," Org.jruby.runtime.Interpreted19Block.evalBlockBody (interpreted19block.java:206) "," Org.jruby.runtime.Interpreted19Block.yield (Int
Logstash data into MongoDB, remove additional information, if delete @timestamp, insert data will be error