JSON Transformation for use in Elastic/Kibana Aggregations

I am working to aggregate key value pairs in Kibana that currently do not have unique key names, because of this I understand that some type of document transformation needs to happen.

These key value pairs are put into an array by the software to get around the unique key name constraint.

The issue i am facing with Kibana is if I write a KQL statement and say find me all documents with a match level 3 and a match key of "+ADDRESS-DOB-GENDER-SSN" after the query executes I lose the context of what key value the aggregation is talking about, I could return 2 million documents but it may just be because one of the subscribers has a match level 3 and not the patient.

I thought about renaming the keys based on what is in the values of other keys in the same object, but don't know how I would start.

Here is an example of the level of aggregation I am looking for:

3 Match Level 3 for Patient

  • 250ACTI11111111111111111, Match Key: +ADDRESS-DOB-GENDER-SSN
  • 950ACTI11111111111111111, Match Key: +GENDER+ADDRESS-DOB-SSN
  • 556ACTI11111111111111111, Match Key: +ADDRESS-DOB-GENDER-SSN

1 Match Level 2 for Patient

  • 702ACTI11111111111111111, Match Key: +NAME+DOB-GENDER-SSN

2 Match Level 3 for Subscriber

  • 752ACTI11111111111111111, Match Key +GENDER+ADDRESS-DOB

  • 592ACT11111111111111111, Match Key: +GENDER+ADDRESS-DOB-SSN

       {
       “actorIdWrappers”: [
              {
            “actorId”: “250ACTI11111111111111111”,
            “matchLevel”: 3,
            “recordCount”: 1,
            “matchKey”: “+ADDRESS-DOB-GENDER-SSN”,
            “actorIdType”: “PATIENT”
          },
          {
            “actorId”: “950ACTI11111111111111111”,
            “matchLevel”: 3,
            “recordCount”: 1,
            “matchKey”: “+GENDER+ADDRESS-DOB-SSN”,
            “actorIdType”: “PATIENT”
          },
          {
            “actorId”: “556ACTI11111111111111111”,
            “matchLevel”: 3,
            “recordCount”: 1,
            “matchKey”: “+ADDRESS-DOB-GENDER-SSN”,
            “actorIdType”: “PATIENT”
          },
          {
            “actorId”: “702ACTI11111111111111111”,
            “matchLevel”: 2,
            “recordCount”: 1,
            “matchKey”: “+NAME+DOB-GENDER-SSN”,
            “actorIdType”: “PATIENT”
          },
          {
            “actorId”: “752ACTI11111111111111111”,
            “matchLevel”: 3,
            “recordCount”: 1,
            “matchKey”: “+GENDER+ADDRESS-DOB”,
            “actorIdType”: “SUBSCRIBER”
          },
          {
            “actorId”: “592ACT11111111111111111”,
            “matchLevel”: 3,
            “recordCount”: 1,
            “matchKey”: “+GENDER+ADDRESS-DOB-SSN”,
            “actorIdType”: “SUBSCRIBER”
          }
       ]
      }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.