From fc3abe4bbba181520cebdb71098185fdba90b5ec Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 6 Aug 2021 16:43:22 +0200 Subject: [PATCH] DOC: changelog entry and bot doc enh for PR#1967 --- CHANGELOG.md | 1 + docs/user/bots.rst | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6c81608e..7c800ff56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ CHANGELOG #### Parsers #### Experts +- `intelmq.bots.experts.truncate_by_delimiter.expert`: Cut string if its length is higher than a maximum length (PR#1967 by Marius Karotkis). #### Outputs - `intelmq.bots.outputs.mcafee.output_esm_ip`: Fix access to parameters, the bot wrongly used `self.parameters` (by Sebastian Wagner). diff --git a/docs/user/bots.rst b/docs/user/bots.rst index 226433f14..cf4d95293 100644 --- a/docs/user/bots.rst +++ b/docs/user/bots.rst @@ -3266,10 +3266,10 @@ For both fields *ip* and *domain*, the *destinations* objects are iterated and i The IntelMQ fields used by this bot may change in the next IntelMQ release, as soon as better suited fields are available. -.. _intelmq.bots.experts.url2fqdn.expert: +.. _intelmq.bots.experts.truncate_by_delimiter.expert: Truncate By Delimiter -^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^ **Information** @@ -3277,22 +3277,25 @@ Truncate By Delimiter * `lookup:` no * `public:` yes * `cache (redis db):` none -* `description:` Cut string if length is bigger than max +* `description:` Cut string if length is bigger than maximum length **Configuration Parameters** -* `delimiter`: example . or ; -* `max_length`: max string length -* `field`: string field +* `delimiter`: The delimiter to be used for truncating, for example ``.`` or ``;`` +* `max_length`: The maximum string length. +* `field`: The field to be truncated, e.g. ``source.fqdn`` -Example: Cut through a long domain with a dot. Truncated until the domain not exceeds the maximum length. +The given field is truncated step-by-step using the delimiter from the beginning, until the field is shorter than `max_length`. -input domain = www.subdomain.web.secondsubomain.test.domain.com -delimiter = '.' -max_length = 20 -results = test.domain.com +Example: Cut through a long domain with a dot. The string is truncated until the domain does not exceed the configured maximum length. -.. _intelmq.bots.experts.truncate_by_delimiter.expert: +- input domain (e.g. ``source.fqdn``): ``www.subdomain.web.secondsubomain.test.domain.com`` +- delimiter: ``.`` +- ``max_length``: 20 +- Resulting value ``test.domain.com`` (length: 15 characters) + + +.. _intelmq.bots.experts.url2fqdn.expert: Url2FQDN ^^^^^^^^