<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>InfluxData Blog - Sam Dillard</title>
    <description>Posts by Sam Dillard on the InfluxData Blog</description>
    <link>https://www.influxdata.com/blog/author/sam-dillard/</link>
    <language>en-us</language>
    <lastBuildDate>Thu, 18 Aug 2022 07:00:00 +0000</lastBuildDate>
    <pubDate>Thu, 18 Aug 2022 07:00:00 +0000</pubDate>
    <ttl>1800</ttl>
    <item>
      <title>InfluxDB OSS Gains Improved User Model, Lots of Flux Enhancements, and Big CLI Additions</title>
      <description>&lt;p&gt;Release Announcement: InfluxDB OSS 2.4&lt;/p&gt;

&lt;p&gt;InfluxDB OSS 2.4 – &lt;a href="https://docs.influxdata.com/influxdb/v2.3/reference/release-notes/influxdb/"&gt;Release Notes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This version of InfluxDB comes with Flux additions and a couple of enhancements to the API that support features of the CLI. The CLI received the most work this time around. See the &lt;a href="https://docs.influxdata.com/influxdb/v2.3/reference/release-notes/influx-cli/"&gt;CLI release notes&lt;/a&gt; for more information on that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhancements:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Added back the v1 InfluxQL shell/REPL. See &lt;a href="https://www.influxdata.com/blog/return-influxdb-v1-shell/"&gt;this blog&lt;/a&gt; post for more information.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Supported v1 dbrp names as bucket IDs in replications API. This makes the creation of replications easier and adds support for replicating to an Enterprise cluster’s v2 /write endpoint.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Changed to operator model such that admin user has instance-level permissions without operator token.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Upgraded Flux from 0.171.0 to 0.179.0&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Flux advancement highlights:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Added multiple new &lt;code&gt;join&lt;/code&gt; functions to the join package such as &lt;code&gt;join.full()&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Promoted &lt;code&gt;experimental.to()&lt;/code&gt; to influxdata.influxdb.wideTo()&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Added built-in function time to the date package to convert any timeable into datetime&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Promoted the following functions from &lt;code&gt;experimental.array&lt;/code&gt; into the array package: &lt;code&gt;array.concat()&lt;/code&gt;, &lt;code&gt;array.filter()&lt;/code&gt;, &lt;code&gt;array.map()&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Promoted the following functions from experimental.http.requests into the http.requests: &lt;code&gt;http.requests.do()&lt;/code&gt;, &lt;code&gt;http.requests.get(&lt;/code&gt;), &lt;code&gt;http.requests.peek()&lt;/code&gt;, &lt;code&gt;http.requests.post()&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Promoted &lt;code&gt;experimental.bitwis&lt;/code&gt;e into the bitwise package&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Supported conditional expressions, constants, and literals in vectorized &lt;code&gt;map()&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 18 Aug 2022 07:00:00 +0000</pubDate>
      <link>https://www.influxdata.com/blog/release-announcement-influxdb-2-4/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/release-announcement-influxdb-2-4/</guid>
      <category>Product</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
    <item>
      <title>Influx CLI Introduces Invokable Scripts, Auth Enhancements, and RE-INTRODUCES the InfluxQL Shell!</title>
      <description>&lt;p&gt;Release Announcement: Influx CLI 2.4&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Influx CLI 2.4&lt;/strong&gt; – &lt;a href="https://docs.influxdata.com/influxdb/v2.3/reference/release-notes/influx-cli/"&gt;Release notes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The InfluxDB CLI is a standalone open source binary that works with both &lt;a href="https://portal.influxdata.com/downloads/"&gt;OSS&lt;/a&gt; and &lt;a href="https://cloud2.influxdata.com/signup"&gt;InfluxDB Cloud&lt;/a&gt;. On rare occasions some updates may apply to one or the other. In this release, each gets their own respective applicable enhancement.&lt;/p&gt;

&lt;p&gt;Documentation for the CLI is contained in both &lt;a href="https://docs.influxdata.com/influxdb/v2.3/reference/cli/influx/"&gt;OSS&lt;/a&gt; and &lt;a href="https://docs.influxdata.com/influxdb/cloud/reference/cli/influx/"&gt;InfluxDB Cloud&lt;/a&gt; documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhancements&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Allowed setting membership type with &lt;code&gt;influx org members add&lt;/code&gt; where only &lt;code&gt;member&lt;/code&gt; was available before&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Added back the InfluxQL Shell (REPL) from v1 with an enhanced experience&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;[Cloud only] Allowed for calling &lt;a href="https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/"&gt;Invokable Scripts&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;[OSS only] Added username and password authentication as alternative to token&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Supported v1 dbrp names as bucket IDs in replications API. This makes the creation of replications easier and adds support for replicating to an Enterprise cluster’s v2 /write endpoint.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 18 Aug 2022 07:00:00 +0000</pubDate>
      <link>https://www.influxdata.com/blog/release-announcement-influx-cli-2-4/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/release-announcement-influx-cli-2-4/</guid>
      <category>Product</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
    <item>
      <title>Edge Data Replication is GA and Flux performance improvements are now available with InfluxDB OSS 2.3</title>
      <description>&lt;p&gt;Check out the GA of &lt;a href="https://www.influxdata.com/blog/edge-data-replication/"&gt;Edge Data Replication&lt;/a&gt; and Flux improvements &lt;a href="https://portal.influxdata.com/downloads"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We’ve been busy bringing the latest improvements to this release. Some of these have been available within InfluxDB Cloud, and now we are pleased to offer them within the open source offering for those of you deploying the OSS version at the edge or developing against it on your local machine.&lt;/p&gt;

&lt;p&gt;Note that releases may be a little lighter as we speed up the release cadence. Development rate should remain or improve, but releases will get tighter.&lt;/p&gt;

&lt;p&gt;For more detail on the release, view the &lt;a href="https://docs.influxdata.com/influxdb/v2.3/reference/release-notes/influxdb/"&gt;release notes&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id="maintenance"&gt;Maintenance&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Upgraded Flux from 0.161.0 to 0.171.0&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Upgraded Go to 1.18.3&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id="flux-advancement"&gt;Flux advancement&lt;/h3&gt;

&lt;p&gt;Flux was upgraded from 0.161.0 to 0.171.0. This includes the following features and enhancements:&lt;/p&gt;

&lt;p&gt;Performance:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Vectorized arithmetic operators in &lt;code class="language-markup"&gt;map()&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Vectorized logical operations in &lt;code class="language-markup"&gt;map()&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Enabled &lt;code class="language-markup"&gt;movingAverage()&lt;/code&gt; and &lt;code class="language-markup"&gt;cumulativeSum()&lt;/code&gt; optimizations by default&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Added &lt;code class="language-markup"&gt;preview()&lt;/code&gt; to experimental package for limiting return rows and tables (as opposed to just rows with &lt;code class="language-markup"&gt;limit()&lt;/code&gt;)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Added &lt;code class="language-markup"&gt;date.scale()&lt;/code&gt; to let users dynamically scale durations in dates&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Added &lt;a href="https://opentracing.io/docs/overview/spans/"&gt;OpenTracing spans&lt;/a&gt; to Flux transformations. This allows developers to more precisely monitor Flux scripts.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Added trace option to Flux CLI&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Moved &lt;code class="language-markup"&gt;addDuration()&lt;/code&gt; and &lt;code class="language-markup"&gt;subDuration()&lt;/code&gt; out of experimental to date package.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Added location support to &lt;code class="language-markup"&gt;date.truncate()&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Added &lt;code class="language-markup"&gt;_status&lt;/code&gt; Tag to PagerDuty record&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Refactored operator profile to be in the query statistics&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id="bug-fixes"&gt;Bug fixes&lt;/h3&gt;

&lt;p&gt;If all of that feature advancement isn’t enough, there are a handful of bug fixes which also have been addressed. Check out the &lt;a href="https://docs.influxdata.com/influxdb/v2.2/reference/release-notes/influxdb/"&gt;release notes&lt;/a&gt; for all the details or if you are looking for a specific fix.&lt;/p&gt;

&lt;p&gt;If you find issues or have questions, please join our &lt;a href="https://influxdata.com/slack"&gt;InfluxDB Community Slack&lt;/a&gt;, post them in our &lt;a href="https://github.com/influxdata/influxdb/issues"&gt;InfluxDB GitHub Repo&lt;/a&gt; or our &lt;a href="https://community.influxdata.com/c/influxdb2"&gt;Community Site&lt;/a&gt; and we will take a look.&lt;/p&gt;
</description>
      <pubDate>Wed, 22 Jun 2022 07:00:00 +0000</pubDate>
      <link>https://www.influxdata.com/blog/release-announcement-influxdb-oss-2-3-edr-flux/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/release-announcement-influxdb-oss-2-3-edr-flux/</guid>
      <category>Product</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
    <item>
      <title>Announcing InfluxDB Edge Data Replication: Combining the Power of the Cloud with the Precision of the Edge</title>
      <description>&lt;p&gt;&lt;em&gt;There are technical and business reasons to have a time series data presence both at the edge and in the cloud – InfluxDB has always played a key role in both contexts. Today, we’re announcing Edge Data Replication, a new feature that combines these two deployment strategies. With this announcement, InfluxData begins a greater initiative to accommodate both edge and cloud data workloads in one unified solution.&lt;/em&gt;&lt;/p&gt;
&lt;hr style="border-top: 1px solid #171717;" /&gt;

&lt;p&gt;The edge is becoming more critical than ever. Businesses requiring new &lt;a href="https://www.influxdata.com/glossary/edge-computing/"&gt;solutions at the edge&lt;/a&gt;, combined with a rapid increase in data from these devices, creates enormous challenges for developers to manage and use that data effectively. Data has gravity and that gravity gets stronger as applications become more distributed and data volumes at the edge grow exponentially.&lt;/p&gt;

&lt;p&gt;Thousands of businesses use &lt;a href="https://docs.influxdata.com/influxdb/v2.2/"&gt;InfluxDB Open Source&lt;/a&gt; (OSS) at the edge for local collection, storage, and processing of &lt;a href="https://www.influxdata.com/what-is-time-series-data/"&gt;time series data&lt;/a&gt;. This gives InfluxDB the role of managing the edge data layer, allowing API access, locally served dashboards, integration with automation and controls, and delivery to alerting systems. In addition, thousands more organizations and developers have adopted &lt;a href="https://cloud2.influxdata.com/signup"&gt;InfluxDB Cloud&lt;/a&gt; to build cloud-native time series applications.&lt;/p&gt;

&lt;p&gt;The needs for edge and cloud data, respectively, are strong – and even strict at times. There are &lt;a href="https://thenewstack.io/bridging-time-series-from-edge-to-cloud/"&gt;many considerations&lt;/a&gt; when choosing the edge or cloud for storage and compute, but ultimately, developers want to ensure these two data layers work together in a simple and efficient way that delivers centralized business insights in near real-time. Up until now, architecting an edge to cloud integration required significant upfront and ongoing investment that is expensive, time-consuming and error-prone.&lt;/p&gt;

&lt;h2 id="introducing-influxdb-edge-data-replication"&gt;Introducing InfluxDB Edge Data Replication&lt;/h2&gt;

&lt;p&gt;Today we’re excited to &lt;a href="https://www.influxdata.com/blog/influxdata-announces-influxdb-edge-data-replication"&gt;announce&lt;/a&gt; the immediate availability of &lt;a href="https://www.influxdata.com/products/influxdb-edge-data-replication/"&gt;Edge Data Replication&lt;/a&gt;, a solution that unifies time series data processing between edge and cloud environments so developers can provide consolidated intelligence across widely distributed environments. Edge Data Replication (EDR) makes it possible to safely replicate data from &lt;a href="https://docs.influxdata.com/influxdb/v2.2/"&gt;InfluxDB OSS&lt;/a&gt; buckets to &lt;a href="https://cloud2.influxdata.com/signup"&gt;InfluxDB Cloud&lt;/a&gt; buckets in real time, meaning users can now collect, store and analyze high-precision time series data from the edge, and view that data in the cloud.&lt;/p&gt;

&lt;p&gt;&lt;img src="//images.ctfassets.net/o7xu9whrs0u9/UVe8hJBKDfxcqgN2D6RPs/c8926dd9542f6d03494d95fad80646e0/InfluxDB_Edge_Data_Replication.png" alt="InfluxDB Edge Data Replication" /&gt;&lt;/p&gt;

&lt;p&gt;This new feature builds upon two key properties of InfluxDB OSS. First, InfluxDB OSS can run very efficiently on resource-constrained systems. Second, InfluxDB OSS runs Flux, a functional data scripting language and task engine that can analyze and transform time series data in any way developers choose. At InfluxData, we’re focused on simplifying the developer experience around times series data, so developing a way to connect these OSS properties to enable a full-featured edge-to-cloud data pipeline was a no-brainer.&lt;/p&gt;

&lt;p&gt;Version 2.2 of InfluxDB introduces a new feature to automate the &lt;a href="https://docs.influxdata.com/influxdb/v2.2/write-data/replication/"&gt;replication&lt;/a&gt; of time series data to other InfluxDB instances. Durable, disk-backed queues add buffering to withstand planned and unplanned disruptions in network connectivity. In addition, this feature configures replication at the &lt;a href="https://docs.influxdata.com/influxdb/v2.2/reference/glossary/#bucket"&gt;bucket&lt;/a&gt; level so developers and operators can precisely define which sets of data to replicate and where to send them.&lt;/p&gt;

&lt;p&gt;This replication happens on-write. When time series data arrives at the edge and matches a replication rule, OSS immediately mirrors the data to the remote bucket defined in the configuration. When InfluxDB OSS cannot send the data to the remote instance, all events buffer in the local durable queue until connectivity is restored. The size and retention of the durable queue are configurable.&lt;/p&gt;

&lt;p&gt;Tangibly, the feature consists of two new API endpoints (&lt;a href="https://docs.influxdata.com/influxdb/v2.2/api/#tag/RemoteConnections"&gt;/remotes&lt;/a&gt; and &lt;a href="https://docs.influxdata.com/influxdb/v2.2/api/#tag/Replications"&gt;/replications&lt;/a&gt;) and two new CLI commands (&lt;a href="https://docs.influxdata.com/influxdb/v2.2/reference/cli/influx/remote/"&gt;remote&lt;/a&gt; and &lt;a href="https://docs.influxdata.com/influxdb/v2.2/reference/cli/influx/replication/"&gt;replication&lt;/a&gt;). Each replicated bucket also gets a disk-backed queue for buffering data safely in case of disruptions.&lt;/p&gt;

&lt;h2 id="giving-distributed-applications-an-edge"&gt;Giving distributed applications an edge&lt;/h2&gt;

&lt;p&gt;Edge Data Replication gives developers a fast and durable way to stream edge data to the cloud, with minimal configuration. This capability gives users the data they need in the cloud to build a global view of all edge activity. Benefits include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Integrate edge and cloud workloads:&lt;/strong&gt; Enables businesses to quickly engage in both edge and cloud computing for their time series workloads, without requiring engineering to introduce or manage any third-party software.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Reduce network costs:&lt;/strong&gt; Edge Data Replication helps users intelligently reduce the volume of data they send to the cloud by leveraging built-in capabilities of the &lt;a href="https://docs.influxdata.com/influxdb/v2.2/process-data/get-started/"&gt;Flux tasks engine&lt;/a&gt;. Operators of OSS nodes at the periphery can pre-compute aggregations and filtering so they can limit the data sent over the internet to the most critical data. They may also use this feature to filter or compute interesting events and forward only those events to the cloud for monitoring.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Transform edge data:&lt;/strong&gt; Dynamically add context to edge data that is necessary for processing in the cloud, which may require extra dimensions to satisfy queries or feature engineering.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Enforce edge-cloud consistency:&lt;/strong&gt; Withstand planned and unplanned disruptions in network connectivity by queueing data at the edge until it can be safely transferred to the cloud.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src="//images.ctfassets.net/o7xu9whrs0u9/4zLyuoBonPcLXoaKs9lhux/dd9c3ea315ff1fe79f1bbb0806dd5836/Giving_distributed_applications_an_edge.png" alt="Giving distributed applications an edge" /&gt;&lt;/p&gt;

&lt;h2 id="reimagining-the-tsdb-architecture"&gt;Reimagining the TSDB architecture&lt;/h2&gt;

&lt;p&gt;Data architects need a robust and repeatable way to design systems that work within the constraints of both the edge and the cloud; systems that understand each of their respective strengths and weaknesses. With Edge Data Replication, we are unlocking a way to accommodate both edge and cloud data workloads with flexibility in the collection, analysis, and storage of time series data – no matter its point of origin or intended destination.&lt;/p&gt;

&lt;h3 id="meeting-developers-where-they-are"&gt;Meeting developers where they are&lt;/h3&gt;

&lt;p&gt;Today’s announcement is an early step in InfluxData’s broader vision to support tomorrow’s technologies, applications, and developer challenges with the InfluxDB platform. It is always our goal to meet developers where they are. With this launch, we’re helping them deliver faster Time to Awesome so they can uncover critical edge insights and move on to other aspects of building their applications.&lt;/p&gt;

&lt;h3 id="get-started-with-edge-data-replication-today"&gt;Get started with Edge Data Replication today&lt;/h3&gt;

&lt;p&gt;To start building your edge-cloud pipeline, sign up for &lt;a href="https://cloud2.influxdata.com/signup"&gt;InfluxDB Cloud&lt;/a&gt; if you haven’t already. Otherwise, check out the &lt;a href="https://docs.influxdata.com/influxdb/v2.2/write-data/replication/"&gt;documentation&lt;/a&gt;. If you’re interested in learning more and enabling edge-cloud duality of time series data, sign up for our upcoming EDR &lt;a href="https://www.influxdata.com/resources/enabling-the-edge-cloud-duality-of-time-series-data/"&gt;webinar&lt;/a&gt; on June 28.&lt;/p&gt;
</description>
      <pubDate>Wed, 15 Jun 2022 06:00:00 +0000</pubDate>
      <link>https://www.influxdata.com/blog/edge-data-replication/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/edge-data-replication/</guid>
      <category>Use Cases</category>
      <category>Product</category>
      <category>Developer</category>
      <category>Company</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
    <item>
      <title>InfluxDB Enterprise 1.9.7 released with enhancements to Flux, Passive Nodes, and Cluster Stability</title>
      <description>&lt;p&gt;InfluxDB Enterprise 1.9.7 — &lt;a href="https://docs.influxdata.com/enterprise_influxdb/v1.9/about-the-project/release-notes-changelog/"&gt;Release notes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Key highlights for this InfluxDB Enterprise release – available &lt;a href="https://portal.influxdata.com/"&gt;here&lt;/a&gt; – include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhancements&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Expose passive nodes to &lt;code class="language-bash" style="font-style: inherit; font-weight: inherit;"&gt;influxd-ctl&lt;/code&gt; command. Passive nodes allow for increased horizontal scaling in the write path.&lt;/li&gt;
 	&lt;li&gt;Throttle replication of incoming writes and hinted hand-off when errors are encountered. This improves cluster stability.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Flux Advancement&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Add &lt;a href="https://docs.influxdata.com/flux/v0.x/stdlib/experimental/http/requests/"&gt;&lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;requests&lt;/code&gt; &lt;/a&gt;&lt;a href="https://docs.influxdata.com/flux/v0.x/stdlib/experimental/http/requests/"&gt;package&lt;/a&gt; for a more full-featured HTTP requests experience&lt;/li&gt;
 	&lt;li&gt;Add &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;isType()&lt;/code&gt; function. This convenience function will allow Flux to check types of columns which will help dynamically apply mathematical operations on a set of Fields that may contain non-numeric Fields.&lt;/li&gt;
 	&lt;li&gt;Added &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;display()&lt;/code&gt; function. This is like a &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;print&lt;/code&gt; statement and will help in debugging Flux scripts as users compose them.&lt;/li&gt;
 	&lt;li&gt;Various enhancements to &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;increase()&lt;/code&gt;, &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;sort()&lt;/code&gt;, &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;derivative()&lt;/code&gt;, &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;union()&lt;/code&gt;, &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;timeshift()&lt;/code&gt;.&lt;/li&gt;
 	&lt;li&gt;Added vectorization to applicable functions like &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;map()&lt;/code&gt;.&lt;/li&gt;
 	&lt;li&gt;Continued performance enhancements (i.e., &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;sort() |&amp;gt; limit()&lt;/code&gt;).&lt;/li&gt;
 	&lt;li&gt;Enhanced &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;mqtt.publish()&lt;/code&gt; to reuse TCP connections when being called in a loop. This allows for functions like &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;map()&lt;/code&gt; run &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;mqtt.publish()&lt;/code&gt; on each row of a table stream without re-establishing the handshake for each record.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Maintenance updates&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Upgrade to Go 1.17.9&lt;/li&gt;
 	&lt;li&gt;Upgrade to &lt;a href="https://docs.influxdata.com/flux/v0.x/release-notes/#v01610-2022-03-24"&gt;Flux v0.161.0&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Bug fixes can be found in &lt;a href="https://docs.influxdata.com/enterprise_influxdb/v1.9/about-the-project/release-notes-changelog/"&gt;release notes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There is no corresponding InfluxDB OSS 1.9 release. While we continue to make improvements to the InfluxDB 1.x code base – and these are being included within InfluxDB Enterprise – we are guiding our community users to InfluxDB 2.x at this time. Of course, you can always build InfluxDB 1.x from source code, if you need to. InfluxDB 2.x does include 1.x compatible interfaces to allow for reads and writes using the 1.x API. The latest open source release can be found on our &lt;a href="https://portal.influxdata.com/downloads"&gt;downloads page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For our InfluxDB Enterprise customers, log in to the &lt;a href="https://portal.influxdata.com/"&gt;InfluxDB Enterprise portal&lt;/a&gt; and download the binaries from there. Need more help? Contact &lt;a href="mailto:support@influxdata.com"&gt;support&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you find issues or have questions, please join our&lt;a href="https://influxdata.com/slack"&gt; InfluxDB Community Slack&lt;/a&gt;, post them in our&lt;a href="https://github.com/influxdata/influxdb/issues"&gt; InfluxDB GitHub Repo&lt;/a&gt; or our&lt;a href="https://community.influxdata.com/c/influxdb2"&gt; Community Site&lt;/a&gt; and we will take a look. Thank you.&lt;/p&gt;
</description>
      <pubDate>Thu, 26 May 2022 04:30:00 +0000</pubDate>
      <link>https://www.influxdata.com/blog/release-announcement-influxdb-enterprise-1-9-7/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/release-announcement-influxdb-enterprise-1-9-7/</guid>
      <category>Product</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
    <item>
      <title>Release Announcement: InfluxDB OSS 2.2.0</title>
      <description>&lt;p&gt;OSS data remote replication, security enhancements, and improvements in Flux &lt;a href="https://portal.influxdata.com/downloads"&gt;available now&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We’ve been busy bringing the latest improvements to this release. Some of these have been available within InfluxDB Cloud, and now we are pleased to offer them within the open source offering for those of you developing against the OSS edition on your laptop or deploying this at the edge.&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;strong&gt;InfluxDB 2.2.0&lt;/strong&gt; &amp;ndash; &lt;a href="https://docs.influxdata.com/influxdb/v2.2/reference/release-notes/influxdb/"&gt; release notes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Feature advancement&lt;/h3&gt;
&lt;p&gt;This release includes the following new features:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Technical Preview: OSS to Cloud data replication&lt;/li&gt;
 	&lt;li&gt;Flux advancement&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;OSS to Cloud data replication&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://www.influxdata.com/blog/edge-data-replication/"&gt;Replication between remote buckets&lt;/a&gt; was introduced in this version. A bucket in OSS can be configured to replicate to a bucket in a remote service. This is a critical capability in topologies combining edge and cloud deployments of InfluxDB.&lt;/p&gt;

&lt;p&gt;This feature is noted as a “technical preview” because it is not yet intended for production use. It is not listed as “experimental” because it is planned as an officially supported feature.&lt;/p&gt;
&lt;h3&gt;Security&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Private IP Validation for Flux and Template Fetching&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Template fetching and some Flux functions make HTTP requests over the network. This feature’s optional configuration can limit InfluxDB’s access to private IPs and therefore the possibility of Server Side Request Forgery (SSRF) attacks. By default, private IPs are still reachable, so there is no breaking change. They can be made inaccessible by invoking the new &lt;code class="language-markup"&gt;--hardening-enabled&lt;/code&gt; flag.&lt;/p&gt;
&lt;h3&gt;Flux advancement&lt;/h3&gt;
&lt;p&gt;Flux was upgraded from 0.139.0 to 0.161.0. This includes the following features and enhancements:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Added new experimental &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;http/requests&lt;/code&gt; package which increases flexibility of Flux to make HTTP calls and use their response data.&lt;/li&gt;
 	&lt;li&gt;Add &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;isType()&lt;/code&gt; function. This convenience function will allow Flux to check types of columns which will help dynamically apply mathematical operations on a set of Fields that may contain non-numeric Fields.&lt;/li&gt;
 	&lt;li&gt;Added &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;display()&lt;/code&gt; function. This is like a &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;print&lt;/code&gt; statement and will help in debugging Flux scripts as users compose them.&lt;/li&gt;
 	&lt;li&gt;Various enhancements to &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;increase()&lt;/code&gt;, &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;sort()&lt;/code&gt;, &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;derivative()&lt;/code&gt;, &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;union()&lt;/code&gt;, &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;timeshift()&lt;/code&gt;.&lt;/li&gt;
 	&lt;li&gt;Added vectorization to applicable functions like &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;map()&lt;/code&gt;&lt;/li&gt;
 	&lt;li&gt;Continued performance enhancements (i.e., &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;sort() |&amp;gt; limit()&lt;/code&gt;)&lt;/li&gt;
 	&lt;li&gt;Enhanced &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;mqtt.publish()&lt;/code&gt; to reuse TCP connections when being called in a loop. This allows for functions like &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;map()&lt;/code&gt; run &lt;code class="language-markup" style="font-style: inherit; font-weight: inherit;"&gt;mqtt.publish()&lt;/code&gt; on each row of a table stream without re-establishing the handshake for each record.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Bug fixes&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;If all of that feature advancement isn’t enough, there are a handful of bug fixes which also have been addressed. Check out the &lt;a href="https://docs.influxdata.com/influxdb/v2.2/reference/release-notes/influxdb/"&gt;release notes&lt;/a&gt; for all the details or if you are looking for a specific fix.&lt;/p&gt;

&lt;p&gt;If you find issues or have questions, please join our&lt;a href="https://influxdata.com/slack"&gt; InfluxDB Community Slack&lt;/a&gt;, post them in our&lt;a href="https://github.com/influxdata/influxdb/issues"&gt; InfluxDB GitHub Repo&lt;/a&gt; or our&lt;a href="https://community.influxdata.com/c/influxdb2"&gt; Community Site&lt;/a&gt; and we will take a look.&lt;/p&gt;
</description>
      <pubDate>Thu, 07 Apr 2022 10:43:34 -0700</pubDate>
      <link>https://www.influxdata.com/blog/release-announcement-influxdb-oss-2-2-0/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/release-announcement-influxdb-oss-2-2-0/</guid>
      <category>Product</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
    <item>
      <title>Usability improvements in the new release of Chronograf</title>
      <description>&lt;p&gt;&lt;strong&gt;Chronograf 1.9.4&lt;/strong&gt; – &lt;a href="https://docs.influxdata.com/chronograf/v1.9/about_the_project/release-notes-changelog/"&gt;Release Notes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This &lt;a href="https://portal.influxdata.com/downloads/"&gt;latest release&lt;/a&gt; of Chronograf includes the following new improvements and fixes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flux&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Chronograf 1.9.4 now includes a Flux Builder to support users who are new to Flux and want a more guided experience building up Flux queries. For those who are new to Flux and starting to use Flux with InfluxDB Enterprise, this new experience provides an easy on ramp for building your first Flux query. The Flux Builder now in Chronograf mirrors what is offered via InfluxDB Cloud and InfluxDB OSS.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Kapacitor integration&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Within Chronograf, you have access to view all of the scripts and tasks that Kapacitor is executing. We've improved the browsing experience to improve the performance of loading and listing TICKscripts and Flux Tasks. This includes the ability to filter by name.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grab the latest bits from our &lt;a href="https://portal.influxdata.com/downloads/"&gt;downloads page&lt;/a&gt; under “Are you interested in InfluxDB 1.x Open Source?”&lt;/p&gt;

&lt;p&gt;If you find issues or have questions, please join our&lt;a href="https://influxdata.com/slack"&gt; InfluxDB Community Slack&lt;/a&gt;, post them in our &lt;a href="https://github.com/influxdata/chronograf/issues"&gt;Chronograf Github Repo&lt;/a&gt; or our&lt;a href="https://community.influxdata.com/c/visualize/"&gt; Community Site&lt;/a&gt; and we will take a look.&lt;/p&gt;
</description>
      <pubDate>Tue, 29 Mar 2022 09:05:54 -0700</pubDate>
      <link>https://www.influxdata.com/blog/usability-improvements-new-release-chronograf/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/usability-improvements-new-release-chronograf/</guid>
      <category>Product</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
    <item>
      <title>Security improvements now available in Kapacitor 1.6.4</title>
      <description>&lt;ul&gt;
 	&lt;li&gt;&lt;strong&gt;Kapacitor 1.6.4&lt;/strong&gt; &amp;ndash; &lt;a href="https://docs.influxdata.com/kapacitor/v1.6/about_the_project/releasenotes-changelog/"&gt;release notes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Includes the following fixes and improvements:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;
&lt;ul class="a"&gt;
 	&lt;li&gt;For those integrating Kapacitor with Kafka, we've added support for SASL-based security authentication. This is similar to the security provided by Telegraf for integrating with Kafka.&lt;/li&gt;
 	&lt;li&gt;We've deprecated additional ciphers that were identified as "weak" as part of the &lt;a href="https://sweet32.info/"&gt;sweet32&lt;/a&gt; attack. These include: DES and RC4. We have also deprecated support for TLS 1.0 and 1.1.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grab the latest bits from our &lt;a href="https://portal.influxdata.com/downloads"&gt;downloads page&lt;/a&gt; under “Are you interested in InfluxDB 1.x Open Source?”&lt;/p&gt;

&lt;p&gt;If you find issues or have questions, please join our&lt;a href="https://influxdata.com/slack"&gt; InfluxDB Community Slack&lt;/a&gt;, post them in our &lt;a href="https://github.com/influxdata/kapacitor/issues"&gt;Kapacitor Github Repo&lt;/a&gt; or our&lt;a href="https://community.influxdata.com/c/influxdb2"&gt; Community Site&lt;/a&gt;, and we will take a look.&lt;/p&gt;
</description>
      <pubDate>Wed, 23 Mar 2022 15:47:56 -0700</pubDate>
      <link>https://www.influxdata.com/blog/security-improvements-now-available-in-kapacitor-1-6-4/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/security-improvements-now-available-in-kapacitor-1-6-4/</guid>
      <category>Product</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
    <item>
      <title>MQTT Topic and Payload Parsing with Telegraf</title>
      <description>&lt;div style="padding:56.25% 0 0 0;position:relative;"&gt;&lt;iframe src="https://player.vimeo.com/video/676028102?h=ac9ecbdd4c&amp;amp;badge=0&amp;amp;autopause=0&amp;amp;player_id=0&amp;amp;app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen="" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="Getting Data into Telegraf"&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;script src="https://player.vimeo.com/api/player.js"&gt;&lt;/script&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Buckle up, this one isn’t short…but I’m hoping it will be thoroughly informative! This post is about Telegraf as a consumer of &lt;a href="https://www.influxdata.com/mqtt/"&gt;MQTT&lt;/a&gt; messages in the context of writing them to InfluxDB. If you are interested in and unfamiliar with Telegraf, you can &lt;a href="https://docs.influxdata.com/telegraf/v1.21/"&gt;view docs here&lt;/a&gt;. Unsure if Telegraf aligns with your needs? I make a case for it in the Optimizing Writes section of &lt;a href="https://www.influxdata.com/blog/optimizing-influxdb-performance-for-high-velocity-data/"&gt;this blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It may also help to have an understanding of &lt;a href="https://docs.influxdata.com/influxdb/v2.1/reference/syntax/line-protocol/"&gt;Line Protocol&lt;/a&gt;, InfluxDB’s default accepted format.&lt;/p&gt;

&lt;p&gt;In this post, I want to impart the efficacy of Telegraf in collecting data over MQTT by a) drilling into a feature of the latest release and b) discussing parsing methodology. As many readers know, MQTT message payloads can be…quite literally whatever you want them to be, so it’s paramount that a subscriber to many topics be able to handle whatever you throw at it.&lt;/p&gt;

&lt;p&gt;Telegraf can subscribe to any number of topics while giving its users control over how it shapes incoming data. Controlling data shape allows users to write out data that is not only compatible for the destination data store, but optimized as well.&lt;/p&gt;

&lt;p&gt;Data shape control in this context comes in two forms, and each will get its own section in this post:&lt;/p&gt;
&lt;ol&gt;
 	&lt;li&gt;Topic parsing&lt;/li&gt;
 	&lt;li&gt;Payload parsing&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Housekeeping:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;All Telegraf behavior below assumes a standard &lt;code class="language-bash" style="font-style: inherit; font-weight: inherit;"&gt;[Agent]&lt;/code&gt; level configuration with &lt;code class="language-bash" style="font-style: inherit; font-weight: inherit;"&gt;omit_hostname = true&lt;/code&gt;&lt;/li&gt;
 	&lt;li&gt;Timestamps are omitted in examples&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Topic parsing&lt;/h2&gt;
&lt;p&gt;In Telegraf’s latest release (v1.21), &lt;a href="https://docs.influxdata.com/telegraf/v1.20/plugins/#mqtt_consumer"&gt;the MQTT Consumer Input Plugin&lt;/a&gt; added the ability to parse information out of topics dynamically and append that information to the payload. This means a Telegraf operator can use data from both the MQTT message payload and the incoming topic.&lt;/p&gt;

&lt;p&gt;Below is a diagram to exemplify four different MQTT message packets being laid out the same way in the InfluxDB data model.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-261648 aligncenter" src="/images/legacy-uploads/mqtt-topic-json-payload-parsing-telegraf.png" alt="MQTT Topic and Payload Parsing with Telegraf" width="1249" height="634" /&gt;&lt;/p&gt;

&lt;p&gt;This is possible with the insertion of Telegraf, and the rest of this post explains how.&lt;/p&gt;

&lt;p&gt;I’ll first explain the problem this solves with examples. Suppose I have a basic sensor emitting a single temperature value to a topic that includes its unique ID; a topic like: &lt;code class="language-bash"&gt;sensors/00191&lt;/code&gt;.  The MQTT messages will be sent to this topic with a single raw value — for this example, let’s say a sample of float &lt;code class="language-bash"&gt;10.0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;No third-party subscriber to this information in &lt;code class="language-bash"&gt;sensors/00191&lt;/code&gt; will know what to do with this temperature value:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;It is not valid LP on its own, so Telegraf will reject it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If you help Telegraf with a &lt;code class="language-bash" style="font-style: inherit; font-weight: inherit;"&gt;data_format="value"&lt;/code&gt; and &lt;code class="language-bash" style="font-style: inherit; font-weight: inherit;"&gt;data_type="float"&lt;/code&gt;, it would generate LP like:&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code class="language-bash"&gt;mqtt_consumer,topic=sensors/00191 value=10.0 &amp;lt;timestamp&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(This is default behavior of input plugins that are given no &lt;a href="https://docs.influxdata.com/influxdb/v2.1/reference/syntax/line-protocol/#measurement"&gt;measurement name&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Notice that Telegraf adds the whole topic as a LP tag by default. This is Telegraf being helpful so you retain any potentially necessary context. Including the whole topic as a single string, however, would necessitate some regex later to be made useful. The reason it’s there is that without it:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;This &lt;code class="language-bash" style="font-style: inherit; font-weight: inherit;"&gt;value&lt;/code&gt; field has no meaning to anyone/anything consuming the data.&lt;/li&gt;
 	&lt;li&gt;Each sensor emitting data like this would overwrite the last sensor's data if written at the same time (tags are needed to differentiate fields like &lt;code class="language-bash" style="font-style: inherit; font-weight: inherit;"&gt;value&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The information needed, in this case, is in the topic. This can happen if a vendor programmed their sensor to emit data this way or if users are working with highly constrained resources and need to keep their payloads as small as possible.&lt;/p&gt;

&lt;p&gt;Enter topic parsing! Telegraf solves this problem without needing to store the whole topic as a tag by allowing users to specify which portions of a topic they want to bring in as measurement, tags, or fields. Before this release, this would have been accomplished with the &lt;a href="https://docs.influxdata.com/telegraf/v1.20/plugins/#regex"&gt;Regex Processor Plugin&lt;/a&gt; but the new experience is simpler and more convenient.&lt;/p&gt;

&lt;p&gt;A simple configuration change to the mqtt_consumer input plugin will give us what we need:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-bash"&gt;[[inputs.mqtt_consumer]]
    servers = ["&amp;lt;address:port&amp;gt;"]
    topics = ["sensors/#"]
    [[inputs.mqtt_consumer.topic_parsing]]
        topic = "sensors/+"
        measurement = "measurement/_"
        tags = "_/sensor_id"&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above snippet of Telegraf configuration instantiates a client subscribed to &lt;code class="language-bash"&gt;sensors/#&lt;/code&gt; (any topic with parent &lt;code class="language-bash"&gt;sensors&lt;/code&gt;). If you’re familiar with Input Plugins like SNMP or parsers like JSON_v2 (going over this next if not!), you’ll recognize the nested TOML table defined by &lt;code class="language-bash"&gt;[[inputs.mqtt_consumer.topic_parsing]]&lt;/code&gt;. There can be any number of these but we only need one. In this table, you tell Telegraf which topics to match on and — with the information that follows — you will parse those topics as their messages arrive.  Following that is where you tell Telegraf what to make a measurement, tag/s, and/or Field/s.  In this case, we are only pulling out the Measurement and a single tag (there isn’t much information to be parsed, after all). No Field present…but that won’t always be the case.&lt;/p&gt;

&lt;p&gt;We use the syntax &lt;code class="language-bash"&gt;measurement/_&lt;/code&gt; in a pair of quotes to telegraph (pun intended) to Telegraf which segments of the topic name will be parsed into what LP elements. Keys map to their respective indexed (by segment) value in the topic, and underscores map to segments that are not relevant to that Line Protocol element (placeholders).&lt;/p&gt;

&lt;p&gt;In the example configuration above, we tell telegraf that the first segment will be our measurement and the second (last) segment will be a tag with key &lt;code class="language-bash"&gt;sensor_id&lt;/code&gt;. The actual information in that segment will be populated as the value of that tag key. If we want to now take out the default &lt;code class="language-bash"&gt;topic&lt;/code&gt; tag, we can include a &lt;code class="language-bash"&gt;topic_tag = ""&lt;/code&gt; parameter in the config and get this output:&lt;/p&gt;

&lt;p&gt;&lt;code class="language-bash"&gt;mqtt_consumer,sensor_id=00191 value=10.0 &amp;lt;timestamp&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Modifications like this matter at scale and with more complicated topics and payloads. It also improves analytics experience downstream…a lot.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Quick note: it’s a best (not necessary) practice to have field names contain useful information so “value” is not ideal. To fix this, you can simply use the &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/processors/pivot"&gt;Pivot Processor&lt;/a&gt; (out of scope for this post).  &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Anyway, speaking of more complicated topics and payloads, let’s look at two more quick brief examples:&lt;/p&gt;

&lt;p&gt;Topic: &lt;code class="language-bash"&gt;detroit/0f801/42.33/-83.04/front_left/09fse21/rpm&lt;/code&gt;
Message: &lt;code class="language-bash"&gt;846&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We want our LP output to have all this information in it. The first segment is the city (site) this vehicle belongs to. The second is the vehicle’s ID. Third is the latitude at that given sample time. Fourth is the longitude, fifth is location of tire on the vehicle, sixth is the tire’s ID, and last is the rpm of that tire. All potentially important information!&lt;/p&gt;

&lt;p&gt;I won’t go into reasoning for what segments should which LP elements — for that, you can refer to the blog post I linked at the top. For this example, we’ll be generic with the measurement and let Telegraf name it. Our measurement will be &lt;code class="language-bash"&gt;mqtt_consumer&lt;/code&gt; (Telegraf can rename this in other plugins if necessary). Every string will be a tag and every numerical element will be a Field. Ultimately, we want our resulting LP to look like:&lt;/p&gt;

&lt;p&gt;&lt;code class="language-bash"&gt;mqtt_consumer,site=detroit,vehicle_id=0f801,tire_id=09fse21 lat=42.33,lon=-83.04,rpm=846 &amp;lt;timestamp&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The following relevant &lt;code class="language-bash"&gt;[[inputs.mqtt_consumer]]&lt;/code&gt; configuration will get us there:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-bash"&gt;...snipped...
    [[inputs.mqtt_consumer.topic_parsing]]
        topic = "+/+/+/+/+/+/+"  # all topics with 7 segments
        tags = "site/vehicle_id/_/_/orientation/tire_id/_"
        fields = "_/_/_/_/_/_/rpm"&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There you have it — a concise configuration for pulling topic-encoded information into Line Protocol records from every single topic that follows a 7-segment structure!&lt;/p&gt;
&lt;h2&gt;Payload parsing!&lt;/h2&gt;
&lt;p&gt;Parser Plugins are not new to Telegraf and neither is specifically JSON parsing but I feel the MQTT consumption topic deserves a drill-down into JSON parsing. First, note that Telegraf offers a &lt;a href="https://docs.influxdata.com/telegraf/v1.20/data_formats/input/"&gt;list of other parsers as well&lt;/a&gt;. Parsers are invoked &lt;em&gt;inside&lt;/em&gt; of plugins with the &lt;code class="language-bash"&gt;data_format&lt;/code&gt; parameter. They are configured slightly differently as their respective formats vary in semantics. For this post, we will focus on JSON parsing.&lt;/p&gt;

&lt;p&gt;JSON parsing in Telegraf has been around a long time, but it was revamped in a &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/parsers/json_v2"&gt;new version a few releases ago&lt;/a&gt;. Just &lt;em&gt;try&lt;/em&gt; to throw at it some JSON it can’t parse!&lt;/p&gt;

&lt;p&gt;Before I dive in here, if you want a thorough walkthrough of this upgraded parser, &lt;a href="https://www.influxdata.com/blog/how-parse-json-telegraf-influxdb-cloud/"&gt;this blog post &lt;/a&gt;by the Telegraf Product Manager, Samantha Wang, is fantastic. Additionally, if you prefer to parse in the Python dialect, there is another way &lt;a href="https://www.influxdata.com/blog/json-to-influxdb-with-telegraf-and-starlark/"&gt;I wrote about here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As you may know, MQTT will accept just about any type of payload.  JSON is the most common in this context. That said, JSON can also be just about any shape so configurable parsing is paramount!&lt;/p&gt;

&lt;p&gt;To bridge the sections, we’ll stick with the last example message but change it up slightly by putting some info that was in the topic into a JSON payload:&lt;/p&gt;

&lt;p&gt;Topic: &lt;code class="language-bash"&gt;detroit/0f801/09fse21&lt;/code&gt;
Message:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-bash"&gt;{
    "orientation": "front_left"
    "latitude": 42.33
    "longitude": -83.04
    "rpm": 846
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For this, the user will want to parse the topic as it comes just as done before. That configuration will look like:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-bash"&gt;...snipped...
    [[inputs.mqtt_consumer.topic_parsing]]
        topic = "+/+/+"  # all topics with 3 segments
        tags = "site/vehicle_id/tire_id"&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For this one, we are keeping the Measurement as we had it (Telegaf’s default per Input) and we are setting no fields. The reason for the latter is we know we can get our fields from the payload this time. So let’s parse it up!&lt;/p&gt;

&lt;p&gt;To make JSON parsing flexible enough to handle heavily nested blobs and other complexities, this new JSON_v2 parser uses nested TOML tables and &lt;a href="https://gjson.dev/"&gt;GJSON querying&lt;/a&gt; for accessing desired blobs. The above message payload is small and flat so the parser will be heavily &lt;em&gt;underutilized&lt;/em&gt; this time.&lt;/p&gt;

&lt;p&gt;From the combination of the above topic and JSON body, we want the same output that we had in the topic parsing example before it. As a refresher that LP looked like:&lt;/p&gt;

&lt;p&gt;&lt;code class="language-bash"&gt;mqtt_consumer,site=detroit,vehicle_id=0f801,tire_id=09fse21 lat=42.33,lon=-83.04,rpm=846 &amp;lt;timestamp&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Keeping in mind the shorter topic we just parsed above, here is the accompanying JSON parsing configuration:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-bash"&gt;...snipped...
data_format = "json_v2" # invokes the parser -- lines following are parser config
[[inputs.mqtt_consumer.json_v2]]
    [[inputs.mqtt_consumer.json_v2.tag]]
        path = "orientation" # GJSON path: JSON is flat -- all keys at root
    [[inputs.mqtt_consumer.json_v2.field]]
        path = "rpm"
        type = "int"
    [[inputs.mqtt_consumer.json_v2.tag]]
        path = "latitude"
        rename = "lat"
        type = "float"
    [[inputs.mqtt_consumer.json_v2.field]]
        path = "longitude"
        rename = "lon"
        type = "float"&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That will produce the same result as the example where all the metadata was in the topic, itself.  Either case is totally within reason.&lt;/p&gt;

&lt;p&gt;I can understand if the JSON parsing looks a little verbose for such a simple JSON blurb. The verbosity glows in more complicated cases. For this case, here is an example of the same result using a different way to parse tags and a different way to parse fields:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-bash"&gt;...snipped...
data_format = "json_v2" # invokes the parser -- lines following are parser config
[[inputs.mqtt_consumer.json_v2]]
    [[inputs.mqtt_consumer.json_v2.object]]
        tags = ["site"] # can list all Tags -- our case only has one
    [[inputs.mqtt_consumer.json_v2.object.field]] # fields by key and type
        rpm = "int"
        latitude = "float"
        longitude = "float"&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That way of defining fields is my favorite part about this parser. So concise! Also notice the &lt;code class="language-bash"&gt;object&lt;/code&gt; table used. If you just need to define your tags and fields and don’t need to do special things with each, these are good methods for keeping your configuration shorter!&lt;/p&gt;
&lt;h2&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;So that’s the nuts and bolts. You now know what it looks like to have Telegraf consume from an MQTT broker, subscribe to many topics, and parse data from the topic and payload simultaneously, merging that data into LP record/s. InfluxDB will love you for this!&lt;/p&gt;

&lt;p&gt;If you’re at a stage where you’re either beginning to develop a pipeline of IoT data and MQTT is in the mix, inserting Telegraf as a consumer (even a producer as well if you feel so inclined) to distribute data to your data stores could be a good move. If you’re using or planning to use InfluxDB as the time series component to your data store layer, Telegraf is optimally designed for feeding InfluxDB. Regardless of where your data ends up, if you need a relatively simple way to get data of various forms and sources from an MQTT broker/cluster, Telegraf can do it.&lt;/p&gt;
</description>
      <pubDate>Mon, 20 Dec 2021 04:00:38 -0700</pubDate>
      <link>https://www.influxdata.com/blog/mqtt-topic-payload-parsing-telegraf/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/mqtt-topic-payload-parsing-telegraf/</guid>
      <category>Use Cases</category>
      <category>Product</category>
      <category>Developer</category>
      <author>Sam Dillard (InfluxData)</author>
    </item>
  </channel>
</rss>
