The Logstash method shown in your screenshot can be done with Virtuoso’s JDBC Driver.
There are some extra requirements when connecting to Virtuoso via JDBC using this method:
jdbc_driver_class
value Must haveJava::
At the beginning- When returning SPARQL queries to Logstash using JDBC, SPARQL-within-SQL must be used to cast Virtuoso ExtendedClass and any other native datatypes as plain strings (SPASQL query example is provided in the “statement” parameter)
input {
jdbc {
jdbc_driver_library => "/absolute_path_to_folder_containing_virtuoso_jdbc_driver/virtjdbc4.jar"
jdbc_driver_class => "Java::virtuoso.jdbc4.Driver"
jdbc_connection_string => "jdbc:virtuoso://localhost:1111"
jdbc_user => "{username}"
jdbc_password => "{password}"
statement => "SELECT CAST(x.s AS varchar) AS test FROM (SPARQL SELECT DISTINCT ?s WHERE {?s ?p ?o} LIMIT 10) as x"
}
}