[Cisco Secure Email Gateway] Fix wrong grok for mail_logs and add new field.#8573
[Cisco Secure Email Gateway] Fix wrong grok for mail_logs and add new field.#8573efd6 merged 4 commits intoelastic:mainfrom leandrojmp:fix_recipient_id_add_email_participants
Conversation
fix wrong grok on mail_logs ingest pipelines and add new field
| link: https://github.com/elastic/integrations/pull/XXXX | ||
| - description: Add new field cisco_secure_email_gateway.log.email_participants. | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/XXXX |
There was a problem hiding this comment.
| link: https://github.com/elastic/integrations/pull/XXXX | |
| - description: Add new field cisco_secure_email_gateway.log.email_participants. | |
| type: enhancement | |
| link: https://github.com/elastic/integrations/pull/XXXX | |
| link: https://github.com/elastic/integrations/pull/8573 | |
| - description: Add new field cisco_secure_email_gateway.log.email_participants. | |
| type: enhancement | |
| link: https://github.com/elastic/integrations/pull/8573 |
There was a problem hiding this comment.
yeah, sorry, I added the PR number, but forget to send the push to my branch.
...ages/cisco_secure_email_gateway/data_stream/log/_dev/test/pipeline/test-common-text-mail.log
Show resolved
Hide resolved
| - '^%{DATA:cisco_secure_email_gateway.log.message_status} %{WORD:network.protocol} DCID %{NUMBER:cisco_secure_email_gateway.log.delivery_connection_id} interface %{IP:cisco_secure_email_gateway.log.interface} address %{IP:cisco_secure_email_gateway.log.address}$' | ||
| - '^%{GREEDYDATA:cisco_secure_email_gateway.log.message_status} DCID %{NUMBER:cisco_secure_email_gateway.log.delivery_connection_id} MID %{NUMBER:email.message_id} to RID \[%{DATA:cisco_secure_email_gateway.log.recipient_id}\]$' | ||
| - '^%{GREEDYDATA:cisco_secure_email_gateway.log.message_status} DCID %{NUMBER:cisco_secure_email_gateway.log.delivery_connection_id} MID %{NUMBER:email.message_id} to RID \[%{DATA:cisco_secure_email_gateway.log.recipient_id}\]$' | ||
| - '^%{GREEDYDATA:cisco_secure_email_gateway.log.message_status} DCID %{NUMBER:cisco_secure_email_gateway.log.delivery_connection_id} MID %{NUMBER:email.message_id} to RID \[%{DATA:cisco_secure_email_gateway.log.recipient_id}\]\s\[%{DATA:cisco_secure_email_gateway.log.email_participants}\]$' |
There was a problem hiding this comment.
Consider populating email.{from,reply_to,to}.address form this?
There was a problem hiding this comment.
Yeah, I'm still working on that and planned to do that on another PR.
The content that would go to the field email_participants can have multiple patterns, the order for from, reply-to and to can change, some of those may not be always present, you can have the emails between < and > sometimes, you also can have just the email or the name and the email, you can have multiple emais with a \r\n\t separator and a couple of more different patterns, so it is not a simple grok in this case.
There was a problem hiding this comment.
Yeah, fair enough. That sounds like it should be in a separate PR.
|
/test |
|
It seems that the test failed because some issue related to the README.md file. Since I'm adding a new field it seems that I also need to add it in the table in the README.md file. Is that correct? |
|
If you run |
Thanks! Just added a description on |
|
Hello @efd6, Can we try to run the tests again? |
|
/test |
🌐 Coverage report
|
| multi_fields: | ||
| - name: text | ||
| type: text |
There was a problem hiding this comment.
This is the first multi_fields field in the set. Do we need this if the field will be further dissected into ECS fields in a future PR?
There was a problem hiding this comment.
I think this is useful because it enables you to search for a string and see if it was present as a participant on the e-mail, for example we had some use cases where we need to search if a particular email address appears as the sender or receiver, so without this we would need to search twice, one on the from field and another on the to field.
Also, all the email.*.address should have the e-mail address only, so if in the from field we have something like Sender Name <anythingelse@example.com>, we need to have just sender@example.com in the email.from.address, and this way we wouldn't be able to search for Sender Name as an email participant.
But, I can remove it and use an alternate custom field in my case.
There was a problem hiding this comment.
Let's remove it for now, but if you file a feature request we can look into adding it in the future.
There was a problem hiding this comment.
Done, removed the multi-field, I will just keep the mapping on my side because it is useful for our use case.
|
/test |
|
Package cisco_secure_email_gateway - 1.20.0 containing this change is available at https://epr.elastic.co/search?package=cisco_secure_email_gateway |
1 similar comment
|
Package cisco_secure_email_gateway - 1.20.0 containing this change is available at https://epr.elastic.co/search?package=cisco_secure_email_gateway |
Proposed commit message
This PR fix an error on a grok pattern for the mail_logs ingest pipelines and creates a new field named
cisco_secure_email_gateway.log.email_participantsaskeywordand with a multi-field astext.Checklist
changelog.ymlfile.Related issues