Collect a custom metric for a custom device
Custom metrics enable you to specify the metric data that the ExtraHop system collects from your network. After you create a custom metric with a trigger, you assign the trigger to your devices. This process is fairly straightforward for devices that are discovered by the ExtraHop system, but custom devices require additional processing.
When you have a custom metric that you want to collect for both discovered and custom devices, your trigger must include instructions on how to handle the different device types.
When a trigger is running on a discovered device, you can collect metrics through the Flow.<role>.device object. However, when a trigger is running on a custom device, you must collect metrics through the Flow.<role>.customDevices array. Both elements must be in any trigger that is assigned to custom and discovered devices.
In the following procedure, we show you how to modify an example trigger that collects a custom metric for HTTP 404 errors. The original trigger was written for only discovered devices, but we show you how to add parameters to collect the metric for custom devices as well.
Before you begin
- This topic assumes that you already have a custom metric that you want to assign to a custom device. For more information, see Create a custom metric, and Build a trigger to collect custom metrics for HTTP 404 errors, and Create a custom device.
- You must have access to an ExtraHop system with a user account that has limited write or full write privileges.
- You must have experience writing JavaScript code.
Thank you for your feedback. Can we contact you to ask follow up questions?