# How to create this multiple line graph?

**URL:** <https://discuss.elastic.co/t/how-to-create-this-multiple-line-graph/135703>\
**Category:** Kibana\
**Created:** [June 13, 2018, 11:29am UTC](https://discuss.elastic.co/t/how-to-create-this-multiple-line-graph/135703 "2018-06-13T11:29:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhilippeCourtemanche](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@PhilippeCourtemanche](https://discuss.elastic.co/u/PhilippeCourtemanche)\
**Post date:** [June 13, 2018, 11:29am UTC](https://discuss.elastic.co/t/how-to-create-this-multiple-line-graph/135703/1 "2018-06-13T11:29:01Z")

</div>

This graph:  
 ![multipleLineGraph](https://us1.discourse-cdn.com/elastic/original/3X/d/a/daa8da75132591e1cb63006519720f3d11b9c2e8.png)

Obtained using these two sql querries:

 ![sqlQuerries](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b35555f0550671217e51a189d20fe8eca12f1ae3.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [June 13, 2018, 1:54pm UTC](https://discuss.elastic.co/t/how-to-create-this-multiple-line-graph/135703/2 "2018-06-13T13:54:49Z")

</div>

Hey @PhilippeCourtemanche, it really depends on how you have your data indexed into Elasticsearch. The following is an example of creating a Line-Chart with a Date Histogram that is creating two lines using a filters aggregation:

 ![35%20AM](https://us1.discourse-cdn.com/elastic/original/3X/9/8/9861b7a50007badbc0d0fc5e6ad33cd215cc85d2.png)

---

<div class="post-metadata">

**Author:** ![PhilippeCourtemanche](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@PhilippeCourtemanche](https://discuss.elastic.co/u/PhilippeCourtemanche)\
**Post date:** [June 13, 2018, 2:11pm UTC](https://discuss.elastic.co/t/how-to-create-this-multiple-line-graph/135703/3 "2018-06-13T14:11:49Z")

</div>

Hi, thanks for the reply  
Would it help you if I sent you my logstash.conf file?

I think that's where I "indexed my data into Elasticsearch".

I'm still new to all of this

---

<div class="post-metadata">

**Author:** ![PhilippeCourtemanche](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@PhilippeCourtemanche](https://discuss.elastic.co/u/PhilippeCourtemanche)\
**Post date:** [June 13, 2018, 2:44pm UTC](https://discuss.elastic.co/t/how-to-create-this-multiple-line-graph/135703/4 "2018-06-13T14:44:16Z")

</div>

Here are the corresponding lines in my logstash.conf file:

input {  
tcp {  
type =\> "tcp\_events"  
port =\> 5000  
}  
jdbc {  
type =\> "jdbc\_nb\_compte"  
schedule =\> "\* \* \* \* \*"  
# Add rest of jdbc config  
# MySQL jdbc connection string to our database, mydb  
jdbc\_connection\_string =\> "jdbc:mysql://192.168.66.11:3306/gmvet"

```
        # The user we wish to execute our statement as
        jdbc_user => "gmvet"
                jdbc_password => "gmvet"

        # The path to our downloaded jdbc driver
        jdbc_driver_library => "/usr/share/logstash/config/mysql-connector-java-5.1.46-bin.jar"

        # The name of the driver class for MySQL
        jdbc_driver_class => "com.mysql.jdbc.Driver"

        # our query
        statement => "select dateCreated as temps,count(*) from Account group by YEAR(dateCreated), MONTH(dateCreated);"
    }
    jdbc {
        type => "jdbc_nb_sites"
                schedule => "* * * * *"

        # Add rest of jdbc config
                # MySQL jdbc connection string to our database, mydb
        jdbc_connection_string => "jdbc:mysql://192.168.66.11:3306/gmvet"

        # The user we wish to execute our statement as
        jdbc_user => "gmvet"
                jdbc_password => "gmvet"

        # The path to our downloaded jdbc driver
        jdbc_driver_library => "/usr/share/logstash/config/mysql-connector-java-5.1.46-bin.jar"

        # The name of the driver class for MySQL
        jdbc_driver_class => "com.mysql.jdbc.Driver"

        # our query
        statement => "select dateCreated as temps, count(*) from Site group by YEAR(dateCreated), MONTH(dateCreated);"
    }

```

}

## Add your filters / logstash plugins configuration here

output {  
if [type] == "jdbc\_nb\_compte" {  
stdout { codec =\> json\_lines }  
elasticsearch {  
hosts =\> "elasticsearch:9200"  
index =\> "jdbc\_nb\_compte\_1"  
document\_type =\> "data"  
}  
}  
if [type] == "jdbc\_nb\_sites" {  
stdout { codec =\> json\_lines }  
elasticsearch {  
hosts =\> "elasticsearch:9200"  
index =\> "jdbc\_nb\_sites"  
document\_type =\> "data"  
}  
}  
}

---

<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 11, 2018, 2:44pm UTC](https://discuss.elastic.co/t/how-to-create-this-multiple-line-graph/135703/5 "2018-07-11T14:44:18Z")

</div>

Closed on July 11, 2018, 2:44pm UTC

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