# Filter node is not working as (I) expected

**URL:** <https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859>\
**Category:** General\
**Created:** [20 December 2023 08:53 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859 "2023-12-20T08:53:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![realtebo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realtebo/32/85732_2.png) [@realtebo](https://discourse.nodered.org/u/realtebo)\
**Post date:** [20 December 2023 08:53 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859/1 "2023-12-20T08:53:48Z")

</div>

I've a filter node, set up as is

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2ce3519228218d5c29182f14d50a3579f9e9601.png)

Very often, more than once daily, this node is re-emitting the same identical value from the same topic.

I'm not using a big number of topics here, \< 30.

What should I do to diagnose the problem?

I tried to manually reinject the same data at high rate, but this is not happening.

I already cheched that data is really really really identical, same float, same number of decimals, no spaces, etc.

Also in NO situtation I got a msg.payload.pump\_id without current\_price. I already added a switch to avoid this reset

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 December 2023 09:31 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859/2 "2023-12-20T09:31:57Z")

</div>

Is node-red restarting? That could cause the problem you are seeing.

To diagnose it you could add a debug node on the output of the Filter node which outputs to the console (which means to the node-red log), then when you detect it has happened you can look back at the log to see what happened around that time.

It isn't a Change node it is a Filter node, I suggest editing the thread title accordingly.

Which versions of node-red and are you using? Right click in the editor and select Show Action List, then search for Show System Info and it will tell you.

---

<div class="post-metadata">

**Author:** ![realtebo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realtebo/32/85732_2.png) [@realtebo](https://discourse.nodered.org/u/realtebo)\
**Post date:** [20 December 2023 10:15 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859/3 "2023-12-20T10:15:16Z")

</div>

> [@Colin](#):
>
> System Info

thanks for suggestion to consult node-red log. I forgot this basic debug technic.

when node-red restarts, it doesn't send any values because I usually leave the option to ignore start values, to avoid a flood of 20-25 messages (i'm sending formatted message to my telegram bot)

I'm using v3.1.3

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 December 2023 10:23 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859/4 "2023-12-20T10:23:34Z")

</div>

> [@realtebo](#):
>
> when node-red restarts, it doesn't send any values because I usually leave the option to ignore start values

But you haven't in this case  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/59941c093e2753f3ce372aa469e3ff3db5007f78.png)

---

<div class="post-metadata">

**Author:** ![realtebo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realtebo/32/85732_2.png) [@realtebo](https://discourse.nodered.org/u/realtebo)\
**Post date:** [20 December 2023 11:49 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859/5 "2023-12-20T11:49:34Z")

</div>

I copy/pasted from a try.

I have ignore initial values in prod

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 December 2023 12:03 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859/6 "2023-12-20T12:03:08Z")

</div>

> [@realtebo](#):
>
> I have ignore initial values in prod

Do you mean that you asked a question and posted an example different to the one that fails?

What version of nodejs are you using (that is also in the system info data)?

---

<div class="post-metadata">

**Author:** ![realtebo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realtebo/32/85732_2.png) [@realtebo](https://discourse.nodered.org/u/realtebo)\
**Post date:** [20 December 2023 14:16 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859/7 "2023-12-20T14:16:28Z")

</div>

Sorry to have paste wrong image, but the problem happens with or without the ignore.

Anyway, I'm trying to debug each single steps and log more data. I am pretty sure it could depends by dirty data coming from api calls.

> node -v  
> v18.19.0

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 February 2024 14:17 UTC](https://discourse.nodered.org/t/filter-node-is-not-working-as-i-expected/83859/8 "2024-02-18T14:17:13Z")

</div>

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