Hello everyone, I want to load a json file into elasticsearch using Logstash.
I am following all the steps but the index is still not showing up in Kibana.
For reference, this is my Logstash configuration file :
Official Elastic Search 8.14 Repo via JARaaS Hybrid RAG - Documentation - code current 6/19/2024 [AI Generated]
Note: Sources at the end of the response
It looks like your Logstash configuration and the logs provided indicate that Logstash is starting and the pipeline is running. However, the data may not be reaching Elasticsearch or being indexed properly. Here are several steps you can take to troubleshoot and resolve this issue:
Check Logstash Output: First, check if Logstash is reading the file and outputting it to the console with the rubydebug codec. This will help you verify if Logstash is ingesting the data properly from the file.
Elasticsearch Connectivity: Make sure Logstash can connect to Elasticsearch. Test the connection from the machine running Logstash to Elasticsearch using a simple curl command:
Look for your smartlight_and_weather_data index in the list.
Logstash Logging: It seems like you're seeing only part of the logs. Increase the verbosity of the logs to debug level to get more information. To do this, you might need to adjust Logstash's log4j2.properties file (usually found in the config directory):
status = debug
Elasticsearch Output Configuration: Ensure your elasticsearch output configuration is correct and matches your Elasticsearch setup.
Here's an updated version of your Logstash config with some added debug options:
Elasticsearch Index Mappings: If there are specific mappings required, you might need to pre-configure the index in Elasticsearch to ensure the data is ingested correctly.
If you've followed all these steps and still don't see the index, it could be helpful to:
Check Elasticsearch logs for any potential issues on the Elasticsearch side.
Verify if there are any errors or warnings in Logstash logs that might provide more context.
This methodical approach should help you identify the point of failure or misconfiguration.
Thank you for your reply !
Yes, I am actually using the full path for my json file.
These are the last logs i see in the file and it has more than one line this way :
["C:/Users/ASUS/Downloads/logstash-8.13.4/logstash.conf"], :thread=>"#<Thread:0x1ca3adff C:/Users/ASUS/Downloads/logstash-8.13.4/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
[2024-06-19T20:31:31,259][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds"=>0.69}
[2024-06-19T20:31:31,279][INFO ][logstash.javapipeline ][main] Pipeline started {"pipeline.id"=>"main"}
[2024-06-19T20:31:31,287][INFO ][filewatch.observingtail ][main][aafdc8a076f0d84187724ad15f4f91129fa77cd97b20f7fe408df0b4d6edf363] START, creating Discoverer, Watch with file and sincedb collections
[2024-06-19T20:31:31,290][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
Thank you for all of your suggestions!
I have tried the 5th and 6th steps but it's unfortunately still not showing up in Kibana and the logs are not giving me much information.
For reference, these are logstash's logs :
["C:/Users/ASUS/Downloads/logstash-8.13.4/logstash.conf"], :thread=>"#<Thread:0x7a92ba3d C:/Users/ASUS/Downloads/logstash-8.13.4/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
[2024-06-19T20:47:22,172][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {"seconds"=>0.82}
[2024-06-19T20:47:22,198][INFO ][logstash.javapipeline ][main] Pipeline started {"pipeline.id"=>"main"}
[2024-06-19T20:47:22,206][INFO ][filewatch.observingtail ][main][aafdc8a076f0d84187724ad15f4f91129fa77cd97b20f7fe408df0b4d6edf363] START, creating Discoverer, Watch with file and sincedb collections
[2024-06-19T20:47:22,219][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
Do not use a json_lines codec with a file input. The file input reads newline delimited lines from the file, strips off the newline, then feeds them to the codec. The codec then waits forever, collecting lines until it gets a newline (which it will never receive).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.