{"id":20847,"date":"2024-05-22T00:45:15","date_gmt":"2024-05-22T07:45:15","guid":{"rendered":"https:\/\/tdengine.com\/?p=20847"},"modified":"2025-03-30T23:31:41","modified_gmt":"2025-03-31T06:31:41","slug":"seamless-data-integration-from-mqtt-and-influxdb-to-tdengine-logstash-like-functionality","status":"publish","type":"post","link":"https:\/\/tdengine.com\/seamless-data-integration-from-mqtt-and-influxdb-to-tdengine-logstash-like-functionality\/","title":{"rendered":"Seamless Data Integration from MQTT and InfluxDB to TDengine"},"content":{"rendered":"\n<p>With TDengine Enterprise and TDengine Cloud&#8217;s data integration capabilities, you can now seamlessly convert data from MQTT and InfluxDB into TDengine, reducing costs and greatly simplifying data conversion tasks for users. This functionality is similar to Logstash in its implementation and usage. This article will explain this feature by comparing it with Logstash.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Logstash: Focused on Log Collection and Organization<\/h2>\n\n\n\n<p>Logstash is an open-source, real-time data collection and processing engine, typically used as an ETL tool. It collects and transforms data from various sources based on conversion rules and then sends it to specified storage. Logstash is commonly used with ElasticSearch (ES), Kibana, and Beats, forming the Elastic Stack (or ELK Stack), a free and open-source toolset for data collection, enrichment, storage, analysis, and visualization.<\/p>\n\n\n\n<p>Logstash can convert data from sources like Beats, Kafka, and DataSource and write it into databases like ES or MySQL for storage:<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-3ec278f1\"><img decoding=\"async\" width=\"1216\" height=\"774\" class=\"gb-image gb-image-3ec278f1\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-1.jpeg?strip=all&sharp=1\" alt=\"\" title=\"Logstash-1\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-1.jpeg?strip=all&amp;sharp=1 1216w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-1-300x191.jpeg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-1-1024x652.jpeg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-1-768x489.jpeg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-1.jpeg?strip=all&amp;sharp=1&amp;w=243 243w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-1.jpeg?strip=all&amp;sharp=1&amp;w=486 486w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-1.jpeg?strip=all&amp;sharp=1&amp;w=972 972w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>Data flow is divided into three main parts: Input, Filter, and Output, covering the entire lifecycle of the data. Both Input and Output support codecs, allowing data to be encoded or decoded when it enters or exits the pipeline without needing a separate filter. Raw data is converted into Events in the Input phase, which are then transformed into target data in the Output phase. The configuration file allows for adding, deleting, modifying, and querying attributes within an Event.<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-9e9b077c\"><img decoding=\"async\" width=\"1280\" height=\"672\" class=\"gb-image gb-image-9e9b077c\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-2.png?strip=all&sharp=1\" alt=\"\" title=\"Logstash-2\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-2.png?strip=all&amp;sharp=1 1280w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-2-300x158.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-2-1024x538.png?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-2-768x403.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-2.png?strip=all&amp;sharp=1&amp;w=512 512w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-2.png?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<figure class=\"gb-block-image gb-block-image-3707eb8d\"><img decoding=\"async\" width=\"1024\" height=\"768\" class=\"gb-image gb-image-3707eb8d\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-3.jpeg?strip=all&sharp=1\" alt=\"\" title=\"Logstash-3\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-3.jpeg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-3-300x225.jpeg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-3-768x576.jpeg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-3.jpeg?strip=all&amp;sharp=1&amp;w=204 204w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-3.jpeg?strip=all&amp;sharp=1&amp;w=409 409w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-3.jpeg?strip=all&amp;sharp=1&amp;w=614 614w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-3.jpeg?strip=all&amp;sharp=1&amp;w=819 819w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"gb-block-image gb-block-image-0834b826\"><img decoding=\"async\" width=\"1010\" height=\"328\" class=\"gb-image gb-image-0834b826\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-4.png?strip=all&sharp=1\" alt=\"\" title=\"Logstash-4\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-4.png?strip=all&amp;sharp=1 1010w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-4-300x97.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-4-768x249.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-4.png?strip=all&amp;sharp=1&amp;w=202 202w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-4.png?strip=all&amp;sharp=1&amp;w=404 404w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/Logstash-4.png?strip=all&amp;sharp=1&amp;w=606 606w\" sizes=\"(max-width: 1010px) 100vw, 1010px\" \/><\/figure>\n\n\n\n<p>The Filter component is the main reason for Logstash&#8217;s powerful functionality. It can perform extensive processing on Logstash Events, such as parsing data, deleting fields, and type conversion. Common filters include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>date: Date parsing<\/li>\n\n\n\n<li>grok: Regex pattern matching and parsing\n<ul class=\"wp-block-list\">\n<li>Regular expression\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.debuggex.com\/\" rel=\"noopener\">Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/regexr.com\/\" rel=\"noopener\">RegExr: Learn, Build, &amp; Test RegEx<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Grok\n<ul class=\"wp-block-list\">\n<li>kibana \u2013 grokdebugger<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/elastic\/logstash\/tree\/v1.4.2\/patterns\" rel=\"noopener\">https:\/\/github.com\/elastic\/logstash\/tree\/v1.4.2\/patterns<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/logstash-plugins\/logstash-patterns-core\" rel=\"noopener\">https:\/\/github.com\/logstash-plugins\/logstash-patterns-core<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/grokdebugger.com\/\" rel=\"noopener\">https:\/\/grokdebugger.com\/<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>dissect: Delimiter-based parsing<\/li>\n\n\n\n<li>mutate: Modify event data, including rename, update, replace, convert, split, gsub, uppercase, lowercase, strip, remove_field, join, merge, etc.<\/li>\n\n\n\n<li>json: Parse JSON fields into specified fields<\/li>\n\n\n\n<li>geoip: Add geographic location data<\/li>\n\n\n\n<li>ruby: Use Ruby code to dynamically modify Logstash Events<\/li>\n<\/ul>\n\n\n\n<p>Example Grok filter configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">filter {\n    grok =&gt; {\n        match =&gt; {\n            &quot;message&quot; =&gt; &quot;%{SERVICE:service}&quot;\n        }\n        pattern_definitions =&gt; {\n            &quot;SERVICE&quot; =&gt; &quot;&#091;a-z0-9]{10,11}&quot;\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p>Logstash is suitable for real-time data processing but is not ideal for all scenarios. For large-scale time-series data processing, TDengine offers its own data integration functionality.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">TDengine: Data Collection for Multiple Sources<\/h2>\n\n\n\n<p>If you use Elasticsearch and Kibana for log management, data analysis, and visualization, Logstash might be a good choice due to its tight integration with Elasticsearch. However, Logstash is not suited for handling large-scale time-series data as it consumes significant system resources, including memory and CPU, and can suffer performance issues with large datasets. Logstash&#8217;s scalability can be limited when dealing with massive amounts of data. Moreover, Logstash requires a steep learning curve as it needs correct configuration for each stage of data processing (input, filter, output), and incorrect configurations can lead to data loss or format errors.<\/p>\n\n\n\n<p>TDengine&#8217;s data integration functionality addresses these limitations, providing a more convenient and cost-effective solution for data conversion tasks if you are using TDengine.<\/p>\n\n\n\n<p>Using TDengine&#8217;s data integration features, you can easily fetch data from MQTT and InfluxDB servers and efficiently write it into the TDengine database, ensuring smooth data integration and analysis. This feature automates the entire data integration process, minimizing manual operations and offering the following benefits:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Support for <\/strong><strong>JSON<\/strong><strong> Format:<\/strong> Leverage the flexibility of JSON, allowing users to ingest and store data in JSON format. Organizations can effectively build and manage data to extract valuable insights from complex data structures.<\/li>\n\n\n\n<li><strong>JSON<\/strong><strong> Path Extraction: <\/strong>TDengine supports JSON path extraction, simplifying the processing of JSON data. By precisely selecting and capturing required data elements, users can focus on core data sets, maximizing analysis efficiency.<\/li>\n\n\n\n<li><strong>Simple Configuration:<\/strong> Provides easy-to-use configuration files where you can specify TDengine&#8217;s super tables, sub-tables, columns, and tags, customizing the data integration process to meet specific needs.<\/li>\n<\/ul>\n\n\n\n<p>After integrating data into TDengine, users can perform data cleaning and transformation based on business needs, achieving a complete ETL process. With these innovative features, real-time data can seamlessly integrate with the high-performance TDengine database, enabling real-time analysis, predictive maintenance, and data-driven decision-making.<\/p>\n\n\n\n<p>The configuration process is straightforward: log in to the TDengine Enterprise or TDengine Cloud web management interface, select &#8220;Data in,&#8221; and add MQTT as a data source. Simply configure the parsing rules for InfluxDB\/MQTT data to correspond to TDengine&#8217;s database, super tables, and sub-tables.<\/p>\n\n\n\n<p>TDengine 3.0 Enterprise Edition and TDengine Cloud provide efficient, reliable data integration methods with easy-to-use command-line operations. Whether you want to migrate data from InfluxDB\/MQTT or consolidate data from multiple sources into TDengine, TDengine 3.0 Enterprise Edition and TDengine Cloud can meet your needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Easily convert and integrate data from MQTT and InfluxDB into TDengine, streamlining data conversion and boosting efficiency for real-time analysis and decision-making.<\/p>\n","protected":false},"author":83,"featured_media":20848,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[21],"tags":[],"ppma_author":[169],"class_list":["post-20847","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-engineering"],"authors":[{"term_id":169,"user_id":83,"is_guest":0,"slug":"liaohaojun","display_name":"Haojun Liao","avatar_url":{"url":"https:\/\/tdengine.com\/wp-content\/uploads\/29.04-21-hjliao.jpg","url2x":"https:\/\/tdengine.com\/wp-content\/uploads\/29.04-21-hjliao.jpg"},"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/20847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/users\/83"}],"replies":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/comments?post=20847"}],"version-history":[{"count":25,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/20847\/revisions"}],"predecessor-version":[{"id":24724,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/20847\/revisions\/24724"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media\/20848"}],"wp:attachment":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media?parent=20847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/categories?post=20847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/tags?post=20847"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/ppma_author?post=20847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}