Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • _vars - allows you to define variable which can be used later on in the script. The parser will basically replace the vars throughout the script with the value you set. For example, this:

    _vars:
    root: $.blahblah

    Means "${root}" will be replaced with "$.blahblah" throughout the script.

  • _tags - device tags. There is also a _tags section under metric, but more on that below. The "_tags" section at the top level is used to define device tags, such as "os.version" or "model". For example:
    _tags:
    "os.name":
    _constant: "panos"
    "os.version":
    _value: "$.system.sw-version"
    "vendor":
    _constant: "paloaltonetworks"
    "model":
    _value: "$.system.model"
  • _metrics - only allowed in monitoring scripts. Metrics are defined under this section. Each metric is under its own "-" section. It looks like this:
    _metrics:
    -
    _value.double:
    _count: "$.entries[0:]"
    _tags:
    "im.name":
    _constant: "routes-usage"

    A few things to note:

    • In case no metrics were parsed (due to missing data or incorrect parsing) then the command will fail; that is, unless some dynamic variables were parsed by the command. 
      • By using _optional_metrics instead of _metrics, one could override this behavior and not fail the command when no metrics are parsed.
    • The "_value.*" operator is used to determine the type of metric (more on this below). The "_value" operator and the "_value.double|complex" are two very different things. The first is used to capture the contents of a specific JsonPath, whereas the second is a header of a section telling the parser what type of metric this is.

    • The "_tags" section here is not the same as the one at the root level (described above). Rather, these are tags to attach to the metric.

...