# Logstash logic to filter jenkins json metrics

**URL:** <https://discuss.elastic.co/t/logstash-logic-to-filter-jenkins-json-metrics/142487>\
**Category:** Logstash\
**Created:** [August 1, 2018, 7:25am UTC](https://discuss.elastic.co/t/logstash-logic-to-filter-jenkins-json-metrics/142487 "2018-08-01T07:25:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rosenrot](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rosenrot](https://discuss.elastic.co/u/rosenrot)\
**Post date:** [August 1, 2018, 7:25am UTC](https://discuss.elastic.co/t/logstash-logic-to-filter-jenkins-json-metrics/142487/1 "2018-08-01T07:25:55Z")

</div>

I want to filter and send jenkins metrics timer data in my logstash conf file. Can someone help me with what should i write in the filter block. So far my logstash conf file contains the below code

 ![json](https://us1.discourse-cdn.com/elastic/original/3X/a/7/a751a1dd326233b4c5167043829ec7a96c204cb6.PNG)

I want get all the data in timer, see image below:

 ![j1](https://us1.discourse-cdn.com/elastic/original/3X/3/c/3c439f4b677e1c9ed75ed0143b4ed924588dc055.PNG)

My code is as follows:

input {  
http\_poller {  
urls =\> {

test1 =\> {  
# Supports all options supported by ruby's Manticore HTTP client  
method =\> get  
url =\> "[http://url/metrics/currentUser/metrics](http://url/metrics/currentUser/metrics)"  
headers =\> {  
Accept =\> "application/json"  
}  
}  
}  
request\_timeout =\> 29

schedule =\> { cron =\> "\* \* \* \* \* UTC"}  
codec =\> "json"

}  
}

filter {  
json {  
source =\> "timers"  
target =\> "timers"  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "final"

}  
stdout { }  
}

---

<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:** [August 29, 2018, 7:25am UTC](https://discuss.elastic.co/t/logstash-logic-to-filter-jenkins-json-metrics/142487/2 "2018-08-29T07:25:56Z")

</div>

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