# Detection rule: Email CSV file as action

**URL:** <https://discuss.elastic.co/t/detection-rule-email-csv-file-as-action/347065>\
**Category:** SIEM\
**Created:** [November 13, 2023, 10:12pm UTC](https://discuss.elastic.co/t/detection-rule-email-csv-file-as-action/347065 "2023-11-13T22:12:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdelgado](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@cdelgado](https://discuss.elastic.co/u/cdelgado)\
**Post date:** [November 13, 2023, 10:12pm UTC](https://discuss.elastic.co/t/detection-rule-email-csv-file-as-action/347065/1 "2023-11-13T22:12:19Z")

</div>

Hello,

When configuring Detection Rules, is there a way to send a CSV file as part of the Email action (when the rule triggers)? I am aware Mustache and Markdown syntax is supported for the email body, but I was wondering if Kibana allows to automatically create a CSV file containing all the generated alerts for the triggered rule, and then send that CSV file in an email as an action.

For example: this text would print in the email body specific fields for all the generated alerts as a table; I am looking to "translate" that table to a CSV file.

```auto
| Date and Time | User | Process |
| :--- | :---: | :---: |
{{#context.alerts}}
| {{@timestamp}} | {{winlog.event_data.SubjectUserName}} | {{process.name}} |
{{/context.alerts}}

```

Any input will be appreciated. Thank you!

Camilo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 11, 2023, 10:13pm UTC](https://discuss.elastic.co/t/detection-rule-email-csv-file-as-action/347065/2 "2023-12-11T22:13:03Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
