Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.76 KB

jq.md

File metadata and controls

57 lines (42 loc) · 1.76 KB

Description:

jq process plugin is intended for parsing JSON data.

Generic parameters:

Param Required Type Template Default Example
include - bool - false true
require - array - [] [1, 2]

Plugin parameters:

Param Required Type Template Default Example Description
find_all - bool - false true Query must be found in all selected Datum fields.
input + array - [] ["data.array0"] List of Datum fields with data.
output + array - [] ["data.array1"] List of target Datum fields.
query + array + [] [".foo", ".bar"] List of config templates/raw queries for searching.

Flow sample:

flow:
  name: "jq-example"

  input:
    plugin: "resty"
    params:
      input: ["https://freegeoip.app/json/"]

  process:
    - id: 0
      plugin: "jq"
      params:
        input:  ["resty.body", "resty.body"]
        output: ["data.array0", "data.array1"]
        query:  ["templates.jq.example", ".ip"]

    - id:  1
      plugin: "echo"
      params:
        input: ["data.array0", "data.array1"]     

Config sample:

[templates.jq.example]
query = [
    '.country_code',
    '.country_name',
]