# Add two value from two record

**URL:** <https://discuss.elastic.co/t/add-two-value-from-two-record/243126>\
**Category:** Logstash\
**Created:** [July 29, 2020, 9:12pm UTC](https://discuss.elastic.co/t/add-two-value-from-two-record/243126 "2020-07-29T21:12:21Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 31, 2020, 6:01pm UTC](https://discuss.elastic.co/t/add-two-value-from-two-record/243126/21 "2020-07-31T18:01:30Z")

</div>

The important thing about example 4 is not that the data comes from jdbc, it is that all the events for a single task id come one after another. In your case the task id is a constant, so that would not work.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [July 31, 2020, 6:33pm UTC](https://discuss.elastic.co/t/add-two-value-from-two-record/243126/22 "2020-07-31T18:33:52Z")

</div>

it is so simple I can't put my finger on what is going wrong.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 31, 2020, 7:33pm UTC](https://discuss.elastic.co/t/add-two-value-from-two-record/243126/23 "2020-07-31T19:33:51Z")

</div>

'--java-execution true' just gets ever more broken.

If you disable the java execution engine then you should get

```
{
  "@version" => "1",
      "tags" => [
    [0] "_aggregatetimeout",
    [1] "_aggregatefinalflush"
],
"@timestamp" => 2020-07-31T19:23:58.136Z,
   "mytotal" => 6.85,
"%{subpool}" => "1"
}

```

With java execution the pipeline does not shutdown and you do not get this message

```auto
[2020-07-31T15:23:58,291][INFO][logstash.pipeline][main] Pipeline has terminated {:pipeline_id=>"main", :thread=>"#<Thread:0x79b128a7 run>"}

```

even though the lines input has sent all the lines.

Alternatively add a file input that tails a non-existent file

```
input { file { path => "/tmp/foo.txt" sincedb_path => "/dev/null" start_position => beginning } }

```

and you will start getting

```
 {
      "tags" => [
    [0] "_aggregatetimeout"
],
  "@version" => "1",
   "mytotal" => 6.85,
"%{subpool}" => "1",
"@timestamp" => 2020-07-31T19:05:58.928Z
}

```

Again, this only happens if the java execution engine is disabled.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [July 31, 2020, 7:52pm UTC](https://discuss.elastic.co/t/add-two-value-from-two-record/243126/24 "2020-07-31T19:52:34Z")

</div>

> [@Badger](#):
>
> --java-execution true

in sort I have to wait for this to get fixed.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [August 3, 2020, 4:02pm UTC](https://discuss.elastic.co/t/add-two-value-from-two-record/243126/25 "2020-08-03T16:02:47Z")

</div>

I have given up on this for now.  
Thought with different logic and setting that up.  
basically I am gone a run another jdbc with total output of two type and create third record in 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:** [August 31, 2020, 4:02pm UTC](https://discuss.elastic.co/t/add-two-value-from-two-record/243126/26 "2020-08-31T16:02:55Z")

</div>

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

[Previous page](https://discuss.elastic.co/t/add-two-value-from-two-record/243126.md?page=1)
