How to convert uuid into string in logstash

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>}"

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

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

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

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

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