# Update Data in Real Time

**URL:** <https://discuss.elastic.co/t/update-data-in-real-time/150220>\
**Category:** Kibana\
**Created:** [September 27, 2018, 3:34pm UTC](https://discuss.elastic.co/t/update-data-in-real-time/150220 "2018-09-27T15:34:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![caesarramy](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@caesarramy](https://discuss.elastic.co/u/caesarramy)\
**Post date:** [September 27, 2018, 3:34pm UTC](https://discuss.elastic.co/t/update-data-in-real-time/150220/1 "2018-09-27T15:34:56Z")

</div>

Hi my code works fine but i have small problem,i want show in kibana update number of connection in port 9080 put he don't let me to do that, cause of in visualize he want me to count or calculate average or sum when i really want message to be updated with real time connection on port 9080 in kibana, kindly advice me how to do that 🙂

input {

exec {  
command =\> "netstat -antulp | grep 9080 | wc -l"  
interval =\> 10  
}

}

filter {  
mutate {  
convert =\> {  
"message" =\> "integer"  
}  
}  
}

output {

elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "helloapache"  
}  
}

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 27, 2018, 3:41pm UTC](https://discuss.elastic.co/t/update-data-in-real-time/150220/2 "2018-09-27T15:41:32Z")

</div>

Hey @caesarramy,

You can use the "Top Hit" aggregation to select the most relevant entry - sorting by time descending should get you the most recent value in your selected time range:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/1/81dde536b1fa9f133724ea4018c7c31aa02634ce.png)

---

<div class="post-metadata">

**Author:** ![caesarramy](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@caesarramy](https://discuss.elastic.co/u/caesarramy)\
**Post date:** [September 27, 2018, 4:01pm UTC](https://discuss.elastic.co/t/update-data-in-real-time/150220/3 "2018-09-27T16:01:03Z")

</div>

Dear Larry\_Gregory Thank you for your help it works 🙂

---

<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:** [October 25, 2018, 4:01pm UTC](https://discuss.elastic.co/t/update-data-in-real-time/150220/4 "2018-10-25T16:01:04Z")

</div>

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