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

Modify Expert: allow non-string values in extra #1460

Closed
grodriguezl opened this issue Oct 7, 2019 · 0 comments
Closed

Modify Expert: allow non-string values in extra #1460

grodriguezl opened this issue Oct 7, 2019 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior component: bots
Milestone

Comments

@grodriguezl
Copy link
Contributor

Modify expert fails when it tries to add a non-string value to extra.something It cannot format a boolean or integer value.

File "/usr/lib/python3.6/site-packages/intelmq/bots/experts/modify/expert.py", line 97, in apply_action
    event.add(name, value.format(msg=event,
AttributeError: 'int' object has no attribute 'format'

Example of config:

[
  {
    "rulename": "Add extra.rule",
    "if": {
        "source.reverse_dns": "^test.com$"
    },
    "then": {
        "extra.test": 1,
        "extra.test2": true
    }
  }
]

event.add(name, value.format(msg=event,
matches={k: MatchGroupMapping(v)
for (k, v) in matches.items()}),
overwrite=self.overwrite)

@ghost ghost added bug Indicates an unexpected problem or unintended behavior component: bots labels Oct 25, 2019
@ghost ghost added this to the 2.0.2 milestone Oct 25, 2019
@ghost ghost self-assigned this Nov 11, 2019
@ghost ghost closed this as completed in dd2d4c4 Nov 11, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: bots
Projects
None yet
Development

No branches or pull requests

1 participant