Collect structured data in bulk and use Zabbix preprocessing to extract and transform the necessary metrics.
Collecting data from custom monitoring endpoints such as web applications or custom in-house software can result in the collected data requiring further extraction or transformation to fit our requirements.
Use Zabbix preprocessing to extract metrics from structured data:
- Extract data with JSONPath and XPath expressions
- Transform XML and CSV data to JSON structures
- Check for error messages in JSON and XML structures
- Extract and transform metrics from Prometheus exporter endpoints
Check out the video to learn how to use Zabbix preprocessing to extract metrics from structured data.
Extract metrics from structured data with Zabbix preprocessing:
- Navigate to Configuration → Hosts
- Find the host where structured data is collected
- Click on the Items button next to the host
- Create or open an item collecting structured data
- For this example, we will transform CSV to JSON
- Open the Preprocessing tab
- Select a structured data preprocessing rule
- If required, provide the necessary parameters
- Optionally, select a validation preprocessing step
- For this example, we will check for errors in JSON
- Extract a value by using JSONPath or XML XPath preprocessing steps
- Press Test to open the test window
- Press Get value and test to test the item
- Close the test window and press Add or Update to add or update the item
- Optionally, create dependent items to extract values from this item
Tips and best practices
You check the Handy Tips #37 to learn how to collect structured data from HTTP end-points
For CSV to JSON preprocessing the first parameter allows you specify a CSV delimiter, while the second parameter specifies the quotation symbol
For CSV to JSON preprocessing If the With header row checkbox is marked, the header line values will be interpreted as column names
For details on XML to JSON preprocessing, refer to our serialization rules for more details.
Learn how to leverage the many types of data collection provided by Zabbix and empower your data collection and processing. Sign up for our Zabbix Certified Specialist course, where under the guidance of a Zabbix certified trainer you will learn more about different types and technologies of monitoring and learn how to get the most out of your Zabbix instance.