Mysql aggregation does not find task_id

Hi there,

Being scratching my head for a while now on the following problem:

I am doing an aggregration on a specific task_id which for some reason works when the input is from a csv log file but not when using a mysql as input.

For your reference the csv log is a backup of the mysql so the data is the same

Here some parts of the code:

CSV Log File:

    input {
  file {
		path => ".../log.csv"
    start_position => "beginning"
    sincedb_path => "NUL"
    }
  }

filter {
  csv {
    skip_header => true
    separator => ";"
    columns => ["id", "TIMESTAMP", "task_id", "message"]
    convert => {
      "id" => "integer"
      }
  

  aggregate {
    task_id => "%{task_id}"
    code => "..."

}

MySQL code:

input {
  jdbc { 
    jdbc_connection_string => "jdbc:mysql://localhost:3306/database?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull"
    # The user we wish to execute our statement as
    jdbc_user => "user"
    jdbc_password => "password"
    # The path to our downloaded jdbc driver
    jdbc_driver_library => "...jdbc.rar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    
    # Every 1 second
	# schedule => "/1 * * * * *"
    
    # our query
    statement => "SELECT id, TIMESTAMP, task_id, message FROM database"
    use_column_value => true
	  tracking_column => "id"
	  tracking_column_type => "numeric"
    #  last_run_metadata_path => ".../logstash_run"
    jdbc_paging_enabled => true
    jdbc_page_size => 50000
    }
  }
filter {
 aggregate {
    task_id => "%{task_id}"
    code => "..."
}

For the mysql code it only pushes the data of the sql query to ES but it "ignores" the aggregation filter.

I am using -w 1 and the task_id is a VARCHAR in mysql.

Any ideas?

Hey,

case is closed.

Solution was that the task_id should always be written down in lower casings.

BR

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