# Check MQTT Message exist in "File"

**URL:** <https://discourse.nodered.org/t/check-mqtt-message-exist-in-file/75496>\
**Category:** General\
**Tags:** function-node, mqtt\
**Created:** [21 February 2023 03:50 UTC](https://discourse.nodered.org/t/check-mqtt-message-exist-in-file/75496 "2023-02-21T03:50:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [21 February 2023 16:20 UTC](https://discourse.nodered.org/t/check-mqtt-message-exist-in-file/75496/3 "2023-02-21T16:20:07Z")

</div>

Maybe an overkill for your situation... In my use case see [Use of NodeRed for international weather, climate, ocean, hydrology data exchange](https://discourse.nodered.org/t/use-of-nodered-for-international-weather-climate-ocean-hydrology-data-exchange/73104) I am using redis to do this kind of check. We use the payload `j3hh432j` as a key in redis. Through redis get/set it is fairly easy to do this. Obviously, you'll need a redis instance (typically a docker version of it will do) for this to work.

As Colin wrote, an array in a persistent context is simpler than "grepping" into a file...

---

_[View the full topic](https://discourse.nodered.org/t/check-mqtt-message-exist-in-file/75496)._
