Import data into ES

Please i really need help.
i want to import json file to my ES using logstash. but nothing goes well on my side.
this is my logstash.conf:
<
input
{
file
{
start_position => "beginning"
path => "C:\Users\Download\out2.json"
sincedb_path => "null"

	}
}

}
filter{
json{
source => "message"
}
}

output{
elasticsearch {
hosts => "http://localhost:9200"
index => "test"
}
stdout { codec => rubydebug { metadata => true } }

stdout { codec => dots }

}
/>

but i got this error:
<
"Using bundled JDK: ""
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Sending Logstash logs to C:/Users/sx074/Tools/logstash-7.13.2/logs which is now configured via log4j2.properties
[2021-07-19T11:37:34,686][INFO ][logstash.runner ] Log4j configuration path used is: C:\Users\sx074\Tools\logstash-7.13.2\config\log4j2.properties
[2021-07-19T11:37:34,704][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.13.2", "jruby.version"=>"jruby 9.2.16.0 (2.5.7) 2021-03-03 f82228dc32 OpenJDK 64-Bit Server VM 11.0.11+9 on 11.0.11+9 +indy +jit [mswin32-x86_64]"}
[2021-07-19T11:37:34,905][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-07-19T11:37:35,524][INFO ][logstash.config.source.local.configpathloader] No config files found in path {:path=>"C:/Users/sx074/Tools/logstash-7.13.2/bin/logstash.conf"}
[2021-07-19T11:37:35,535][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.
[2021-07-19T11:37:35,905][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2021-07-19T11:37:40,939][INFO ][logstash.runner ] Logstash shut down.
[2021-07-19T11:37:40,952][FATAL][org.logstash.Logstash ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.16.0.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.16.0.jar:?]
at C_3a_.Users.sx074.Tools.logstash_minus_7_dot_13_dot_2.lib.bootstrap.environment.(C:\Users\sx074\Tools\logstash-7.13.2\lib\bootstrap\environment.rb:89) ~[?:?]
/>

Hi,

How did you run logstash ?
Where is located your configuration file .conf ?

HI

  • logstash -f logstash.conf

About my .conf file :
input
{
file
{
start_position => "beginning"
path => "C:/Users/Download/out2.json"
sincedb_path => "null"

	}
}

}
filter{
json{
source => "message"
}
}

output{
elasticsearch {
hosts => "http://localhost:9200"
index => "test"
}
stdout {}

}

It looks like you run the command in
C:/Users/sx074/Tools/logstash-7.13.2/bin
So with the command

You tell to logstash that the configuration file is in C:/Users/sx074/Tools/logstash-7.13.2/bin but it seems that is not the case according to the error :

So edit your run command with the full path to the conf file instead of just giving the name of the file.

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