# Can't write data into graphite from database query

**URL:** <https://discuss.elastic.co/t/cant-write-data-into-graphite-from-database-query/103711>\
**Category:** Logstash\
**Created:** [October 12, 2017, 11:26am UTC](https://discuss.elastic.co/t/cant-write-data-into-graphite-from-database-query/103711 "2017-10-12T11:26:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivier974](https://avatars.discourse-cdn.com/v4/letter/o/3be4f8/32.png) [@olivier974](https://discuss.elastic.co/u/olivier974)\
**Post date:** [October 12, 2017, 11:26am UTC](https://discuss.elastic.co/t/cant-write-data-into-graphite-from-database-query/103711/1 "2017-10-12T11:26:12Z")

</div>

hello,

I'm trying to extract some data from an oracle db containing KPIs to our graphing tool which is based on graphite.

I'm can easily get the data from the DB with the logstash-input-jdbc plugin

{  
"instance" =\> "1.6",  
"@timestamp" =\> 2017-10-12T10:10:02.398Z,  
"event\_date" =\> 2017-10-12T08:00:00.000Z,  
"host" =\> "cohosted2",  
"@version" =\> "1",  
"description" =\> "Valid\_SM\_Status\_User\_Error",  
"sms\_type" =\> "MO/Valid\_SM",  
"value\_sum" =\> 127.0,  
"type" =\> "yearly\_kpi"  
}

But when trying to send the datas to graphite using this configuration :

if [type] == "yearly\_kpi" {  
graphite {  
metrics =\> { "SMSC/%{host}/YEARLY\_KPI/%{sm\_type}/%{description}/%{instance}/per\_hour" =\> "%{value\_sum}" }  
timestamp\_field =\> "event\_date"  
host =\> "opkibws1"  
port =\> "2003"  
}  
stdout { codec =\> rubydebug }  
}

I got no output and the following error message into logstash-stderr.log : Could not load : can't convert nil into String

I got the feeling that the fields are not available anymore.

How could I get it work ?

BR

---

<div class="post-metadata">

**Author:** ![olivier974](https://avatars.discourse-cdn.com/v4/letter/o/3be4f8/32.png) [@olivier974](https://discuss.elastic.co/u/olivier974)\
**Post date:** [October 13, 2017, 7:55am UTC](https://discuss.elastic.co/t/cant-write-data-into-graphite-from-database-query/103711/2 "2017-10-13T07:55:19Z")

</div>

found out all alone ...

I got a typo in one of the field ....

---

<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:** [November 10, 2017, 7:55am UTC](https://discuss.elastic.co/t/cant-write-data-into-graphite-from-database-query/103711/3 "2017-11-10T07:55:48Z")

</div>

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