NXLog Platform User Guide

Preview events processed by an agent

You can capture events being processed by an agent to troubleshoot or verify an NXLog Agent configuration. For each captured event, NXLog Platform shows the event before and after a module instance processes it, and highlights the fields the module instance added, removed, or changed.

You capture events from the Log flow view on an agent details page.

The Log flow view on an agent’s details page is different from the Log flow page in the left navigation menu, which visualizes the data flow between your configurations and destinations. See Create a data flow visualization.

Prerequisites

To capture events, you need:

  • NXLog Agent 6.17 or later. The Log flow view isn’t available for agents that don’t support capturing events.

  • The Admin or Agent Management role. Users with the Agent Management — read-only role can open the Log flow view, but the capture buttons are deactivated. See Roles and permissions.

  • An enrolled, online agent with a configuration assigned. See Assign a configuration.

Capture events

To capture the events passing through an agent:

  1. Navigate to Agents from the left navigation menu.

  2. Locate the agent in the agents table and click its name.

  3. Switch to the Log flow view. The view shows the module instances in the agent’s configuration and the routes connecting them as a graph.

    Agent log flow view
  4. Click the module instance whose events you want to see. The inspector pane opens at the bottom of the page.

  5. Optionally, choose how long the capture runs from the Capture drop-down list: 1, 5, 15, or 30 seconds. The default is 5 seconds. NXLog Platform keeps your choice until you reload the page.

  6. Click Capture followed by the duration, for example, Capture 5s. While the capture runs, the pane shows the elapsed time.

    Live event capture

    A capture stops when the time elapses or it captures 1,000 events, whichever comes first. When the capture ends, the pane shows how many events it captured.

    Only one capture can run on a module instance at a time. If another user, or you in another browser tab, is already capturing the module instance’s events, wait for that capture to end.

Filter captured events

Capture filters limit the events to capture. The agent tests each event against the filters and only sends the events that match to NXLog Platform.

  1. In the inspector pane, click the funnel button.

  2. Enter a Pre-filter, a Post-filter, or both:

    • The pre-filter applies before the module instance’s Exec block and matches the event as the module instance received it.

    • The post-filter applies after the module instance’s Exec block and matches the event as the module instance modified it, including fields it added or changed.

      Live event capture filters
  3. Click Apply & capture to start a new capture.

Filters are NXLog language expressions that evaluate to TRUE or FALSE. They use the same syntax as conditions in an NXLog Agent configuration, not the filter syntax used elsewhere in NXLog Platform. For example, use == to test for equality, not =. See Expressions and Operators for the full syntax.

Table 1. Capture filter examples
Filter Expression Captures

Pre-filter

$raw_event =~ /auth/

Events whose raw event contains auth when the module instance receives them.

Post-filter

$Severity == "ERROR"

Events with the Severity field set to ERROR after the module instance processes them.

NXLog Platform checks the filter syntax. If a filter is invalid or the agent can’t use it, NXLog Platform shows an error and doesn’t start the capture.