# Mysql aggregation does not find task\_id

**URL:** <https://discuss.elastic.co/t/mysql-aggregation-does-not-find-task-id/199800>\
**Category:** Logstash\
**Created:** [September 17, 2019, 10:09am UTC](https://discuss.elastic.co/t/mysql-aggregation-does-not-find-task-id/199800 "2019-09-17T10:09:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewToThis](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@NewToThis](https://discuss.elastic.co/u/NewToThis)\
**Post date:** [September 17, 2019, 10:09am UTC](https://discuss.elastic.co/t/mysql-aggregation-does-not-find-task-id/199800/1 "2019-09-17T10:09:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![NewToThis](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@NewToThis](https://discuss.elastic.co/u/NewToThis)\
**Post date:** [September 18, 2019, 6:29am UTC](https://discuss.elastic.co/t/mysql-aggregation-does-not-find-task-id/199800/2 "2019-09-18T06:29:24Z")

</div>

Hey,

case is closed.

Solution was that the task\_id should always be written down in lower casings.

BR

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 16, 2019, 6:29am UTC](https://discuss.elastic.co/t/mysql-aggregation-does-not-find-task-id/199800/3 "2019-10-16T06:29:26Z")

</div>

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