# I need to create a custom application that interfaces with Elasticsearch similar to how Rally does

**URL:** <https://discuss.elastic.co/t/i-need-to-create-a-custom-application-that-interfaces-with-elasticsearch-similar-to-how-rally-does/225904>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [March 31, 2020, 3:45pm UTC](https://discuss.elastic.co/t/i-need-to-create-a-custom-application-that-interfaces-with-elasticsearch-similar-to-how-rally-does/225904 "2020-03-31T15:45:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidmarsh](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@davidmarsh](https://discuss.elastic.co/u/davidmarsh)\
**Post date:** [March 31, 2020, 3:45pm UTC](https://discuss.elastic.co/t/i-need-to-create-a-custom-application-that-interfaces-with-elasticsearch-similar-to-how-rally-does/225904/1 "2020-03-31T15:45:19Z")

</div>

I've been studying Rally to try to see an example of how an application might interface with Elasticsearch. The problem is that so far I haven't discovered where Rally communicates with Elasticsearch. Of particular interest is the Rally code that sends data to be indexed to Elasticsearch and the code that issues queries. Is there anyone familiar with Rally that could point me in the right direction?

---

<div class="post-metadata">

**Author:** ![baz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baz/32/5183_2.png) [@baz](https://discuss.elastic.co/u/baz)\
**Post date:** [March 31, 2020, 4:05pm UTC](https://discuss.elastic.co/t/i-need-to-create-a-custom-application-that-interfaces-with-elasticsearch-similar-to-how-rally-does/225904/2 "2020-03-31T16:05:22Z")

</div>

Hi @davidmarsh,

Rally uses the [rally-track](https://github.com/elastic/rally-tracks/) repository to define what operations a particular track will execute. These map back to [concrete actions in rally here](https://github.com/elastic/rally/blob/master/esrally/track/track.py#L472-L473). I have highlighted the create index operation, and you can see it defined in a [track's operations](https://github.com/elastic/rally-tracks/blob/master/eventdata/challenges/default.json#L10-L12).

Now this action is [registered here](https://github.com/elastic/rally/blob/master/esrally/driver/runner.py#L50), so any time this action is executed, [this code is run](https://github.com/elastic/rally/blob/master/esrally/driver/runner.py#L989).

Rally uses the [python elasticsearch client](https://elasticsearch-py.readthedocs.io/en/master/) under the hood.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![davidmarsh](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@davidmarsh](https://discuss.elastic.co/u/davidmarsh)\
**Post date:** [April 1, 2020, 5:22pm UTC](https://discuss.elastic.co/t/i-need-to-create-a-custom-application-that-interfaces-with-elasticsearch-similar-to-how-rally-does/225904/3 "2020-04-01T17:22:15Z")

</div>

Thanks Michael, that was very helpful. Dave Marsh

---

<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:** [April 29, 2020, 8:46pm UTC](https://discuss.elastic.co/t/i-need-to-create-a-custom-application-that-interfaces-with-elasticsearch-similar-to-how-rally-does/225904/5 "2020-04-29T20:46:57Z")

</div>

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