Set up the Log Parser Connector for Easy Integration of your log based sensors/metrics - TeamViewer Support
<main>
<article class="userContent">
<p><br></p><p>The <strong>TeamViewer IoT Log Parser Connector</strong> easily extracts & integrates sensor data from your log files.</p><p>The <strong>Log Parser Connector</strong> is generic, in that, it can be used to parse any log. For the context of this article, it is assumed your IoT sensor values are written to a log file which you would like to connect to the TeamViewer IoT Agent.</p><p>The setup contains two basic steps. Follow the sections in this article:</p><ol><li>Download and install the Log Parser Connector</li><li>Integrate the Log Parser Connector with the TeamViewer IoT Agent</li></ol><p>For more information about configuration and syntax see <a href="https://community.teamviewer.com/English/kb/articles/109846-configuration-and-syntax-of-the-teamviewer-log-parser-connector" rel="nofollow noreferrer ugc">Configuration and Syntax of the TeamViewer Log Parser Connector</a>.</p><p><br></p><h3></h3><h2 data-id="what-you-will-need">What you will need</h2><p>Make sure that you have prepared the following points:</p><p>📌<strong>Note:</strong> Python 2 is not supported.</p><ul><li><strong>Python 3</strong> is installed on the Edge Device (see <a href="https://www.python.org/downloads/" rel="nofollow noreferrer ugc">https://www.python.org/downloads/</a>).</li><li><a href="https://community.teamviewer.com/English/kb/articles/109829-access-the-edge-device-via-remote-terminal" rel="nofollow noreferrer ugc">Access the Edge Device via Remote Terminal</a>.</li><li>The edge device is set up with a TeamViewer IoT Agent and <a href="https://community.teamviewer.com/English/kb/articles/109820-enable-the-edge-management" rel="nofollow noreferrer ugc">TeamViewer Edge Management is enabled</a>.</li><li>The edge device is connected to the internet.</li><li>Basic knowledge of the editor <a href="https://www.nano-editor.org/" rel="nofollow noreferrer ugc">nano</a>.</li></ul><p><br></p><h3 data-id="-1"></h3><h2 data-id="download-and-install-the-log-parser-connector">Download and install the Log Parser Connector</h2><p>1. Access the edge device remotely (<a href="https://community.teamviewer.com/English/kb/articles/109829-access-the-edge-device-via-remote-terminal" rel="nofollow noreferrer ugc">Access the Edge Device via Remote Terminal</a>).</p><p>2. Download the <strong>Log Parser Connector</strong>. In the terminal type in the following command and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">wget https://download.teamviewer-iot.com/connectors/teamviewer-iot-log-parser/1.0.0/teamviewer_iot_log_parser-1.0.0.tar.gz
</pre><p>3. Upon completion of the download, extract the contents of the connector. In the terminal type in the following commands and press return:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo mkdir -p /usr/local/teamviewer-iot-agent/monitoring/
tar -xzvf teamviewer_iot_log_parser-1.0.0.tar.gz -C /usr/local/teamviewer-iot-agent/monitoring/
</pre><p>4. Install the Log Parser Connector. In the terminal type in the following command and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">cd teamviewer_iot_log_parser-1.0.0 python3 setup.py install
</pre><p>5. Verify the installation was successful by identifying a log file to parse and using the following command to parse a string. In the terminal type in the following command and press return. Replace <code class="code codeInline" spellcheck="false" tabindex="0">logFilePath</code> & <code class="code codeInline" spellcheck="false" tabindex="0">justTextorRegex</code> with the path of your log file and a string to search for, respectively.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">teamviewer_iot_log_parser -f logFilePath --regex justTextOrRegex
</pre><p><br></p><h3 data-id="-2"></h3><h2 data-id="integrate-the-log-parser-connector-with-the-teamviewer-iot-agent">Integrate the Log Parser Connector with the TeamViewer IoT Agent</h2><p>The TeamViewer IoT Agent includes its own system monitoring <strong>configuration file</strong>. This configuration file will be extended to include the Log Parser configuration.</p><p><strong>📌Note: </strong>Before editing files mentioned in this task create a backup. Use the backups in case of a corrupted system or data.</p><p>For each sensor you want to integrate, append its registration information to the configuration file. Reference the <a href="https://community.teamviewer.com/English/kb/articles/109848-teamviewer-iot-log-parser-connector-template" rel="nofollow noreferrer ugc">Log Parser Connector Template</a> or the <a href="https://community.teamviewer.com/English/kb/articles/109849-examples-configuration-of-the-connector-using-the-monitoringparams" rel="nofollow noreferrer ugc">Examples</a> and replace the placeholders with your sensor details.</p><p>1. To modify the <strong>configuration file</strong> open the file with <strong>nano</strong>:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">nano /var/lib/teamviewer-iot-agent/system_monitors.conf
</pre><p>2. Modify the configuration file as needed.</p><p>3. Save the file and exit nano.</p><p>4. Restart the IoT Agent to reload the configuration file. In the terminal type in the following command and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">teamviewer-iot-agent restart
</pre><p>5. To log in to the <strong>IoT Management Console</strong>, open <a href="https://teamviewer-iot.com" rel="nofollow noreferrer ugc">https://teamviewer-iot.com</a> and use your TeamViewer account credentials.</p><p>6. From the left menu select <strong>Dashboard</strong>.</p><p>7. Verify that the Sensors/Metrics added to the configuration file now appear on your <strong>Metrics </strong>tab.</p><p>8. <a href="https://community.teamviewer.com/English/kb/articles/109861-add-a-widget" rel="nofollow noreferrer ugc">Use a Widget</a> to pin the metrics to your dashboard and ensure the data is being updated per the frequency specified in the config file.</p><p><br></p><h3 data-id="-3"></h3>
</article>
</main>