Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

使用 syslog 配置规则

完成 syslog 提取设置后,您现在可以使用 syslog 作为传感器创建规则。

此规则包括三个元素:

  • syslog 传感器

  • 四个字段捕获感兴趣的数据

  • 指示接口何时关闭的触发器

注意:

有关已配置内容的更多详细信息,请参阅本节末尾的使用说明。

  1. 单击左侧导航栏中的配置>规则
  2. 在“规则”页面上,单击“+ 添加规则”按钮。
  3. 在出现的页面上,在规则窗口的第一行中,设置规则名称。在此示例中,它是 check-interface-status
  4. 如果您愿意,请添加描述和概要。
  5. 单击“+ 添加传感器”按钮,然后在“传感器”选项卡中输入以下参数:
    Configuration interface for setting up a syslog sensor named if-status-sensor with options to add or delete the sensor.
  6. 现在移动到“字段”选项卡,单击“+ 添加字段”按钮,然后输入以下参数以配置名为 event-id 的第一个字段:
    Configuration interface for defining fields in a software application with tabs for sensors, fields, vectors, and more. Field list shows event-id, fpc-slot, if-name, and snmp-index. Field configuration panel highlights event-id with options for description, field type, rule key, ingest type as Sensor, sensor as if-status-sensor, path as event-id, zero suppression, and data if missing. Action buttons for adding or deleting fields.
  7. 再次单击“+ 添加字段”按钮,然后输入以下参数以配置名为 fpc-slot 的第二个字段:
    Configuration interface for defining fields in a data processing system. Fields tab selected with fpc-slot field being edited. Options include field type, data source as Sensor, and zero suppression toggle.
  8. 再次单击“+ 添加字段”按钮,然后输入以下参数以配置名为 if-name 的第三个字段:
    Configuration interface for defining fields in a software app with tabs: Sensors, Fields, Vectors, Variables, Functions, Triggers, Rule Properties. Field being configured: if-name. Includes empty Description box, Field Type dropdown, Add to Rule Key toggle off, Ingest Type set to Sensor with if-status-sensor, Path set to if-name, Zero Suppression toggle off, Data if Missing dropdown set to all interfaces. Delete button for if-name. Existing fields: event-id, fpc-slot, if-name, snmp-index.
  9. 再次单击“+ 添加字段”按钮,然后输入以下参数以配置名为 snmp-index 的第四个字段:
    Configuration interface for defining fields in software; Fields tab selected. Field name: snmp-index, Ingest type: Sensor, Sensor: if-status-sensor. Add field and Delete snmp-index buttons available.
  10. 现在移动到“触发器”选项卡,单击“+ 添加触发器”按钮,然后输入以下参数以配置名为 link-down 的触发器:
    Configuration interface for setting up monitoring triggers. Trigger named link-down detects link-down events every 2 seconds. Conditions check event-id for SNMP_TRAP_LINK-DOWN and PSEUDO_FPC_DOWN. Actions set color to red and display link-down messages.
  11. 在窗口的右上角,单击“+ Save & Deploy”按钮。

规则的用法说明

  • 传感器选项卡

    • 传感器名称 if-status-sensor 是用户定义的。

    • 传感器类型为 syslog

    • 模式集 check-interface-status - 假定模式集配置较早。

    • 如果未设置,则“最大保留期”默认为 1 秒。

  • “字段”选项卡

    • 定义了四个字段;尽管模式捕获了四个以上的数据字段,但此示例在此处定义了四个感兴趣的字段;这些字段在触发器设置中使用。

    • 字段名称(event-idfpc-slotif-namesnmp-index)由用户定义。

    • 路径 event-id - 由 syslog 摄取在原始表中创建的默认字段;引用模式配置中的字段。

    • 路径 FPC - 引用非结构化模式配置中使用的过滤器中的值。

    • 路径 if-name - 引用模式配置中的接口名称字段。请参阅 配置系统日志引入

      • 缺少 所有接口 时的数据 - 如果系统日志消息中未包含 if-name 值,请使用字符串值“all interfaces”。

    • 路径 snmp-index - 引用模式配置中的字段。

  • “触发器”选项卡

    • 触发器名称 link-down 是由用户定义的。

    • 频率 2s - Paragon Insights 每 2 秒检查一次链路关闭系统日志消息

    • 术语 is-link-down - 当 $event-idSNMP_TRAP_LINK_DOWN 类似时,在最后 300 秒内的任何 syslog 消息中,将红色变为红色并显示消息 Link down for $if-name(snmp-id: $snmp-index)。

      • $event-id - $ 表示引用规则字段 event-id

      • 关闭 $if-name(snmp-id: $snmp-index) 的链接 - 例如,“Link down for ge-2/0/0 of FPC 2”。

      • $if-name - 引用字段值,即系统日志消息中的接口名称。

    • 术语 is-fpc-down - 当 $event-idPSEUDO_FPC_DOWN 类似时,在最后 300 秒内的任何 syslog 消息中,将红色变 为红色 并显示消息 Link down for $if-name of FPC$fpc-slot

      • $event-id - $ 表示引用规则字段 event-id

      • $if-name - “所有接口”。

      • 关闭链接以获取 FPC$fpc-slot 的$if名称,例如,“Link down for all interfaces of FPC 2”。