Masking

Apply masks to samples

Applies a masking operator's masks to sample log events and returns the masked result for each, so the editor can preview a configuration without deploying it. The operator's predicate gates which logs are masked in production, not how, so it is ignored here and the masks are applied to every sample.

post/v1/masking/mask

Request

  • Base URL
    https://docs.grepr.ai (the document declares no server; this is the origin it was published from)
  • Auth
    • API key in header GREPR-API-KEY
    • or OpenID Connect (https://grepr-prod.us.auth0.com/.well-known/openid-configuration)

Request body

Example request

{
  "masking": {
    "attributeMasks": [
      {
        "masks": {
          "email": "\\S+@\\S+"
        },
        "path": [
          "user",
          "contact"
        ]
      }
    ],
    "messageMasks": {
      "email": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
    },
    "name": "operation_name",
    "predicate": {
      "query": "service:grepr-service-1"
    }
  },
  "samples": [
    {
      "attributes": {
        "user": {
          "email": "alice@example.com"
        }
      },
      "message": "user alice@example.com signed in from 10.1.2.3"
    }
  ]
}

Response

Sample masked successfully.

Example response

{
  "results": [
    {
      "maskedCount": 3,
      "maskedMessage": "user [email] signed in from [ip]"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.