Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [Automatic Import] Remove fields with @ from the script processor (#201548) #201589

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…astic#201548)

## Summary

This PR filters the fields containing `@` in date type from `script`
processor.

## Before this PR

![image](https://github.com/user-attachments/assets/a733d81f-aaaf-4787-b974-1e5d35ff4b8f)

```json
    {
      "script": {
        "tag": "script_convert_array_to_string",
        "description": "Ensures the date processor does not receive an array value.",
        "lang": "painless",
        "source": "if (ctx.varonis?.varonis_alerts?.@timestamp != null &&\n    ctx.varonis.varonis_alerts.@timestamp instanceof ArrayList){\n    ctx.varonis.varonis_alerts.@timestamp = ctx.varonis.varonis_alerts.@timestamp[0];\n}\n"
      }
    },
    {
      "date": {
        "if": "ctx.varonis?.varonis_alerts?.@timestamp != null",
        "tag": "date_processor_varonis.varonis_alerts.@timestamp",
        "field": "varonis.varonis_alerts.@timestamp",
        "target_field": "event.start",
        "formats": [
          "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
          "ISO8601"
        ]
      }
    },
```

## After this PR

```json
      "date": {
        "if": "ctx.varonis?.varonis_alerts?.@timestamp != null",
        "tag": "date_processor_varonis.varonis_alerts.@timestamp",
        "field": "varonis.varonis_alerts.@timestamp",
        "target_field": "event.start",
        "formats": [
          "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
          "ISO8601"
        ]
      }
    },
```

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 8964dc9)
@bhapas bhapas added release_note:fix Team:Security-Scalability Team label for Security Integrations Scalability Team labels Nov 25, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-scalability (Team:Security-Scalability)

@kibanamachine kibanamachine merged commit 6185384 into elastic:8.x Nov 25, 2024
28 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @bhapas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_note:fix Team:Security-Scalability Team label for Security Integrations Scalability Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants