Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metricbeat] SQL module converts NULL cells to strings #18898

Closed
sayden opened this issue Jun 2, 2020 · 1 comment · Fixed by #18955
Closed

[Metricbeat] SQL module converts NULL cells to strings #18898

sayden opened this issue Jun 2, 2020 · 1 comment · Fixed by #18955
Labels
bug Metricbeat Metricbeat Team:Services (Deprecated) Label for the former Integrations-Services team

Comments

@sayden
Copy link
Contributor

sayden commented Jun 2, 2020

How to reproduce: Using the following query, it generates a VARCHAR | NULL result

- module: sql
  metricsets:
    - query
  period: 10s
#  hosts: ["dbname=ps user=root pass=root host=172.18.0.2"]
  hosts: ["root:root@tcp(172.18.0.2:3306)/ps"]

  driver: "mysql"
  sql_query: "SELECT 'key', NULL"
  sql_response_format: variables

- module: sql
  metricsets:
    - query
  period: 10s
  #  hosts: ["dbname=ps user=root pass=root host=172.18.0.2"]
  hosts: ["root:root@tcp(172.18.0.2:3306)/ps"]

  driver: "mysql"
  sql_query: "SELECT 'key', NULL"
  sql_response_format: table

Expected output:

{
  "sql": {
    "query": "SELECT 'key', NULL",
    "metrics": {
      "numeric": {},
      "string": {
        "key": "NULL"
      }
    },
    "driver": "mysql"
  }
}
{
  "sql": {
    "query": "SELECT 'null', NULL",
    "metrics": {
      "numeric": {},
      "string": {
        "key": "NULL"
      }
    },
    "driver": "mysql"
  }
}

Expected output:

{
  "sql": {
    "query": "SELECT 'key', NULL",
    "metrics": {
      "numeric": {},
      "string": {
        "key": null
      }
    },
    "driver": "mysql"
  },
  "event": {
    "dataset": "sql.query",
    "module": "sql",
    "duration": 603087
  }
}
{
  "sql": {
    "query": "SELECT 'key', NULL",
    "metrics": {
      "numeric": {},
      "string": {
        "key": null
      }
    },
    "driver": "mysql"
  },
}
@sayden sayden added bug Metricbeat Metricbeat Team:Services (Deprecated) Label for the former Integrations-Services team labels Jun 2, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Metricbeat Metricbeat Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants