Hi,
I want to run following SQL statment:
input {
jdbc {
jdbc_driver_library => "/app/logstash-5.6.2/lib/ojdbc7.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@localhost:1521/apextst"
jdbc_user => ""
jdbc_password => ""
jdbc_fetch_size => 3000
statement => "select round(sum(used.bytes) / 1024 / 1024/1024 ) || ' GB' "Database Size",
round(free.p / 1024 / 1024/1024) || ' GB' "Free space"
from (select bytes from v$datafile
union all select bytes from v$tempfile
union all select bytes from v$log) used,
(select sum(bytes) as p from dba_free_space) free
group by free.p"
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["localhost:9200"]
index => "logstash-database-info"
document_type => "mytype"
}
}
This is giving following error:
Sending Logstash's logs to /app/logstash-5.6.2/logs which is now configured via log4j2.properties
[2017-10-29T01:09:56,411][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/app/logstash-5.6.2/modules/netflow/configuration"}
[2017-10-29T01:09:56,445][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/app/logstash-5.6.2/modules/fb_apache/configuration"}
[2017-10-29T01:09:56,814][ERROR][logstash.agent ] Cannot create pipeline {:reason=>"Expected one of #, {, } at line 9, column 83 (byte 419) after input {\n jdbc {\n jdbc_driver_library => "/app/logstash-5.6.2/lib/ojdbc7.jar"\n jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"\n jdbc_connection_string => "jdbc:oracle:thin:@localhost:1521/apextst"\n jdbc_user => "DBA_WORK"\n jdbc_password => "DBA_WORK123"\n jdbc_fetch_size => 3000\n statement => "select round(sum(used.bytes) / 1024 / 1024/1024 ) || ' GB' ""}
I can able to small SQL statement but facing problem to execute big SQL statement.
Can you please help this?
How can i execute big SQL statment?