Last active
January 24, 2017 21:00
-
-
Save tsundara/ca70fee65b075184428f2651bdd52b72 to your computer and use it in GitHub Desktop.
Oracle to Logstash - Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#A sample config file for exporting data from Oracle to ElasticSearch | |
#Note the capital J in "Java" for jdbc_driver_class | |
input { | |
jdbc { | |
jdbc_connection_string => "jdbc:oracle:thin:@oraclehost:1522/ORASID" | |
jdbc_user => "oracle_user" | |
jdbc_password => "oracle_password" | |
jdbc_driver_library => "/home/tsundara/elk/logstash-2.3.4/lib/jdbc_libs/ojdbc6.jar" | |
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver" | |
statement => "SELECT * from ADDRESS where STATE_PROVINCE='NJ'" | |
} | |
} | |
output { | |
stdout { codec => json_lines } | |
} | |
# How to run it | |
export JAVA_HOME=/path/to/jdk8 | |
./logstash-2.3.4/bin/logstash -f oracle_to_elastic.conf Logstash startup | |
#Check1 : Get the list of existing indexes (2 ways listed below) | |
curl http://localhost:9200/_aliases?pretty=1 | |
curl 'localhost:9200/_cat/indices?v' | |
# Display the data for "blog" index | |
curl -XGET "http://localhost:9200/blog/_search?size=50&pretty" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment