# Need help aggregating strings from logs

**URL:** <https://discuss.elastic.co/t/need-help-aggregating-strings-from-logs/271428>\
**Category:** Elasticsearch\
**Created:** [April 27, 2021, 6:12pm UTC](https://discuss.elastic.co/t/need-help-aggregating-strings-from-logs/271428 "2021-04-27T18:12:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitishj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitishj/32/87805_2.png) [@nitishj](https://discuss.elastic.co/u/nitishj)\
**Post date:** [April 27, 2021, 6:12pm UTC](https://discuss.elastic.co/t/need-help-aggregating-strings-from-logs/271428/1 "2021-04-27T18:12:03Z")

</div>

I wish to create a dashboard with a dataset consisting of 3 variables out of which I want to see average values of 2 (after theyr're grouped the third variable). For example, I would like to see the solverObjVal and SolverRuntime averages for each day grouped by numNodes. Each message that contains the string "Optimization completed successfully" has these 3 data points and I want to extract all these messages and the 3 values mentioned above. How do I go about doing this? I wrote a query to visually see all the messages containing "Optimization completed successfully" but I am not sure how to parse the message and extract the 3 values required (along with timestamp). See example of logs below:

```auto
message:[2021-04-27 13:27:27,081: INFO] [__main__](optimizeJobWrapper-13a258d1569e4586a7097508ccf19e76) Optimization completed successfully, writing optimizeResponse to Kafkatopic=dev-chi-location.optimizeResponse. Status=OPTIMAL, LocationId=6087d7fe127b9e4v3e09efef, SolverRuntime=0.0262660980225, SolverObjval=3081750.2839, numNodes=2 @timestamp:April 27th 2021, 09:27:30.994

```

---

<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:** [May 25, 2021, 6:12pm UTC](https://discuss.elastic.co/t/need-help-aggregating-strings-from-logs/271428/2 "2021-05-25T18:12:48Z")

</div>

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