Preview processing rule

Preview processing rule

POSThttps://cloud-api.calyptia.com/v1/preview_processing_rule
Authorization
Body
actions*array of RuleActionV1 (object)
logs*array of FluentBitLog (array of any of)
Response

OK

Body
itemsany of
Example: "[1234.5, {\"key\": \"value\"}]"
Request
const response = await fetch('https://cloud-api.calyptia.com/v1/preview_processing_rule', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "language": "lua",
      "actions": [
        {
          "kind": "add",
          "description": "Sample action",
          "enabled": true,
          "selectors": [
            {
              "kind": "key",
              "op": "equal",
              "expr": "some_key"
            }
          ]
        }
      ],
      "logs": [
        [
          "[1234.5, {\"key\": \"value\"}]"
        ]
      ]
    }),
});
const data = await response.json();
Response
[
  [
    "[1234.5, {\"key\": \"value\"}]"
  ]
]