# How to get the Metric Tag working using JDBC

**URL:** <https://discuss.elastic.co/t/how-to-get-the-metric-tag-working-using-jdbc/137576>\
**Category:** Logstash\
**Created:** [June 27, 2018, 8:51am UTC](https://discuss.elastic.co/t/how-to-get-the-metric-tag-working-using-jdbc/137576 "2018-06-27T08:51:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyler\_Amos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tyler_amos/32/32725_2.png) [@Tyler\_Amos](https://discuss.elastic.co/u/Tyler_Amos)\
**Post date:** [June 27, 2018, 8:51am UTC](https://discuss.elastic.co/t/how-to-get-the-metric-tag-working-using-jdbc/137576/1 "2018-06-27T08:51:13Z")

</div>

I'm trying to create an Emails dashboard using the built in Metrics tag where the email information is being pulled from on Oracle Database. The query is below:

```
SELECT
  id
, status
, first_requested_date
, first_sent_date
FROM [transmissions]
WHERE status != 'SENT'

```

In Kibana when we view the output the numbers all seem dramatically big, recording like 30 million outbound emails when realistically there is no where near this amount. I think its because logstash is struggling to establish a timestamp link to the database timestamp columns but can't find any documentation on how to do this!

Here is the filter that it is using:

```
filter {
  if [type] == "jdbc" {
    if [index_name] == "email_status" {
      if [db_sid] == "XXX" {
        metrics {
          meter => ["eml_%{status}"]
          add_tag => "metric"
          add_field => {
            "index_name" => "email_status"
            "type" => "jdbc"
            "db_sid" => "XXX"
          }
        }
      }
    }
  }
}

```

TL:DR - How do I align database datetime column to logstash's timestamp?

Any Help would be much appreciated,

Many Thanks,  
Tyler

---

<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:** [July 25, 2018, 8:51am UTC](https://discuss.elastic.co/t/how-to-get-the-metric-tag-working-using-jdbc/137576/2 "2018-07-25T08:51:15Z")

</div>

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