Uploaded image for project: 'Metron (Retired)'
  1. Metron (Retired)
  2. METRON-1606

Add a 'wrap' to incoming messages in the metron json parser

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Done
    • Minor
    • Resolution: Done
    • None
    • 0.6.0
    • None

    Description

      For many use cases, the user may not have control over the format of the json that is coming in.  Some services send 'documents' with many atomic json entries, that are not in a coherent array, and cannot be referenced or parsed.

       

      It would be useful to simply have the option for the JSONMap parser to be configured to 'wrap' the incoming document in an array and holding entity.  This would allow it to be parsed and addressed by JSONPath.

       

      {data},
      {data}

      ,

      {data},

       

      wraps to:

       

      { "wrapName" : [
      {data}

      ,

      {data},
      {data}

      ]

      }

       

      that can be then referenced by a jsonPath statement : $.wrapperName[*]  or something more complex

       

      So you would configure the parser

      wrapIncomming : 'true' # This wraps the incomming bytes in a json construct, { NAME : [ CONTENT ] }
      .wrapContructName : 'messages' # default name for the wrapping construct, this name should be referenced in your jsonpath statement

       

      The assumption here is that the entities, while not wrapped or in an array, are still comma separated.

       

      Attachments

        Issue Links

          Activity

            People

              otto Otto Fowler
              laurensv Laurens Vets
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: