# Subtracting term X from log a from term Y from log b?

**URL:** <https://discuss.elastic.co/t/subtracting-term-x-from-log-a-from-term-y-from-log-b/99407>\
**Category:** Elasticsearch\
**Created:** [September 5, 2017, 11:03am UTC](https://discuss.elastic.co/t/subtracting-term-x-from-log-a-from-term-y-from-log-b/99407 "2017-09-05T11:03:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [September 5, 2017, 11:03am UTC](https://discuss.elastic.co/t/subtracting-term-x-from-log-a-from-term-y-from-log-b/99407/1 "2017-09-05T11:03:41Z")

</div>

Hi after watching [this](https://www.youtube.com/watch?v=yBf7oeJKH2Y) video, made by @Mark_Harwood.  
I understood that for every period of time I have to send the logs regarding a certain entity to a new index. for example for every message, I have 6 logs and I need to subtract a term from the 6th log with the 1st log, I will have to send all 6 logs to a new index.

doesn't this create too many indexes?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 5, 2017, 12:23pm UTC](https://discuss.elastic.co/t/subtracting-term-x-from-log-a-from-term-y-from-log-b/99407/2 "2017-09-05T12:23:51Z")

</div>

You only need one index for entities. You patch it with updates from your event index

---

<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 3, 2017, 12:23pm UTC](https://discuss.elastic.co/t/subtracting-term-x-from-log-a-from-term-y-from-log-b/99407/3 "2017-10-03T12:23:56Z")

</div>

Closed on October 3, 2017, 12:23pm UTC

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