Logstash Ruby : Find Matching Value From Two Different Array

I have two different arrays outputs and info.policy.rules coming in the same log document and I would like to run a ruby loop to find if there is any matching value available for adderss field in the array of outputs against an array value of info.policy.rules.condition.address. If the value is found, I would like to add a new filed result : matchFound

outputs array sample :

"outputs": [
      {
        "wallet": "my_wallet",
        "valueUnitAmount": value,
        "id": "my_id",
        "address": "1234",
        "chain": 0,
        "value": value,
        "isSegwit": false,
        "walletInfo": {
          "walletStorageType": "WARM",
          "displayName": "warm",
          "policy": {
            "thresholdBal": 38,
            "thresholdTX": 20
          },
          "walletId": "my_id",
          "type": "warm"
        },
        {
         "wallet": "my_wallet",
        "valueUnitAmount": value,
        "id": "my_id",
        "address": "12345",
        "chain": 0,
        "value": value,
        "isSegwit": false,
        "walletInfo": {
          "walletStorageType": "hot",
          "displayName": "hot",
          "policy": {
            "thresholdBal": 38,
            "thresholdTX": 20
          }
          "walletId": "my_id",
          "type": "hot"
        },   
      }
    ]

info.policy.rules array sample :

"info": {
      "policy": {
        "rules": [
          {
            "coin": "btc",
            "id": "my_id",
            "condition": {
              "address": "12345",
              "label": "warm",
              "type": "address"
            },
            {
            "coin": "btc",
            "id": "my_id",
            "condition": {
              "address": "12",
              "label": "warm",
              "type": "address"
            },
            {
            "coin": "btc",
            "id": "my_id",
            "condition": {
              "address": "23",
              "label": "warm",
              "type": "address"
            }
            "action": "log",
            "type": "whitelist"
          }
        ]
      }
    }

can anyone help?

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