From 1fedeb2081a9534b9ac60aa76f6875bb0c196602 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Sat, 30 Nov 2024 18:20:53 -0500 Subject: [PATCH] Added documentation to Meshtastic ingestor on how to collect MQTT evens in JSON --- ingestors/ingest_meshtastic.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ingestors/ingest_meshtastic.py b/ingestors/ingest_meshtastic.py index 55363fa..bbe8770 100644 --- a/ingestors/ingest_meshtastic.py +++ b/ingestors/ingest_meshtastic.py @@ -2,6 +2,14 @@ # Elasticsearch Recon Ingestion Scripts (ERIS) - Developed by Acidvegas (https://git.acid.vegas/eris) # ingest_meshtastic.py +''' +This plugin needs the meshtastic-mqtt-json library to convert Meshtastic MQTT messages to JSON. + pip install meshtastic-mqtt-json + +Use this command to pipe Meshtastic MQTT messages to the ERIS FIFO when using the --watch flag: + meshtastic-mqtt-json > ERIS_FIFO_PATH +''' + import asyncio import json import logging @@ -23,7 +31,8 @@ def construct_map() -> dict: # Match on exact value or full text search keyword_mapping = { 'type': 'text', 'fields': { 'keyword': { 'type': 'keyword', 'ignore_above': 256 } } } - return { + # Construct the index mapping + mapping = { 'mappings': { 'properties': { 'channel' : { 'type': 'long'}, @@ -128,6 +137,8 @@ def construct_map() -> dict: } } + return mapping + async def process_data(input_path: str): '''