How to convert uuid into string in logstash


(Aarthini) #1

My table structure is
create table dev.emp (
empid int,
emp_first varchar,
emp_last varchar,
empno uuid primary key,
);
Logstash configuration is
input {

	jdbc{
	jdbc_connection_string => "jdbc:cassandra://localhost:9042/dev"
	jdbc_user => "cassandra"
	jdbc_password => "cassandra"
	jdbc_driver_library => "/Users/nfrteam/.DbSchema/drivers/Cassandra/cassandrajdbc1.1.jar"
	jdbc_driver_class => "com.dbschema.CassandraJdbcDriver"
	statement => "SELECT * FROM dev.emp"
	tags => ["jdbc2"]
}

output{
if "jdbc2" in [tags]{
stdout {
codec => "rubydebug"
}
}
}

I'm getting this error "Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::OrgLogstash::MissingConverterException: Missing Converter handling for full class name=java.util.UUID, simple name=UUID>}"


SQL query from Logstash causes an error PGobject
(Magnus B├Ąck) #2

Update your SQL statement to convert the UUID column into a varchar.


(Aarthini) #3

But in my table uuid is necessary while using in logstash I m getting error . How to use uuid in logstash ?


#4

He's not asking you to change your database table structure, just the SELECT query for logstash. ('SELECT CAST(empno AS varchar) .... ')


(Aarthini) #5

SELECT CAST (empno AS varchar) FROM dev.emp;
SyntaxException: line 1:19 missing ')' at 'AS' (SELECT CAST (empno [AS] varchar...)
Its not working .


(system) #6

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