'Logstash jdbc query not detecting a field with name 'tags'

For jdbc plugin, I have to query a json field named 'tag'.

  jdbc {
    tags => "example"
    statement => " SELECT tag:text from db_name"
    <=====all other configs=====>
}

and I have added this field as json in filter ,

if "example" in [tags] {
    json {
      source => "tags"
      target => "tags"
    }
}

It seems the tags field is not producing any data. But it is working as expected when I have added some alias to tag field. Like,

SELECT tag:text as xyz from db_name

Is there any way to escape the keyword 'tag' ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source