From e9e3a3fee1ed25a3b1bf53ec65eaa09c1124c735 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 3 Mar 2021 23:59:21 +0100 Subject: [PATCH 1/2] Improve README: Add another recipe for advanced schema manipulation --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e2cf2a0..ed44866 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,8 @@ influxdb-fetcher \ ### Rename fields As the line protocol format is pure ASCII, it is easy to use standard Unix tools -like `sed` to manipulate the content. - +like `sed` to manipulate the content. For more advanced manipulations, we +recommend to use Perl. Those are some examples which roughly outline the process. ```sh # Fetch data. @@ -60,13 +60,24 @@ influxdb-fetcher ... > data.wireproto # Manipulate schema: Rename field. sed -i -e "s/foo\=\([0-9.]*\)/bar=\1/g" data.wireproto +# Manipulate schema: Advanced field renaming with negative lookbehind. +# This renames all fields not already prefixed with `SonoffSC.`. +perl -pi -e " + s/(? Date: Thu, 4 Mar 2021 00:02:21 +0100 Subject: [PATCH 2/2] Improve README: Rename lineprotocol export file to `data.lineproto` --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ed44866..6b5b9bb 100644 --- a/README.md +++ b/README.md @@ -55,10 +55,10 @@ recommend to use Perl. Those are some examples which roughly outline the process ```sh # Fetch data. -influxdb-fetcher ... > data.wireproto +influxdb-fetcher ... > data.lineproto # Manipulate schema: Rename field. -sed -i -e "s/foo\=\([0-9.]*\)/bar=\1/g" data.wireproto +sed -i -e "s/foo\=\([0-9.]*\)/bar=\1/g" data.lineproto # Manipulate schema: Advanced field renaming with negative lookbehind. # This renames all fields not already prefixed with `SonoffSC.`. @@ -69,15 +69,15 @@ perl -pi -e " s/(?