# Dynamic date to Watcher email

**URL:** <https://discuss.elastic.co/t/dynamic-date-to-watcher-email/300687>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [March 25, 2022, 11:00am UTC](https://discuss.elastic.co/t/dynamic-date-to-watcher-email/300687 "2022-03-25T11:00:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angad\_Panesar1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/angad_panesar1/32/79499_2.png) [@Angad\_Panesar1](https://discuss.elastic.co/u/Angad_Panesar1)\
**Post date:** [March 25, 2022, 11:00am UTC](https://discuss.elastic.co/t/dynamic-date-to-watcher-email/300687/1 "2022-03-25T11:00:47Z")

</div>

Hi

I want to add a date to the watcher command shown below right into the file name without having to type in a different one manually all the time. E.g. PM2.5\_arista\_report\_24Mar22. Is there any way that you can help me with this please?

```auto
PUT _watcher/watch/arista_dash
{
  "trigger" : {
    "schedule": {
      "daily" : { "at" : "01:15" }
    }
  },
  "actions" : {
    "email_admin" : { 
      "email": {
        "to": "'Angad Panesar <a.p@mm.co.uk>'",
        "subject": "Arista PDF",
        "attachments" : {
          "PM2.5_arista_report_{date-1}.pdf" : {
            "reporting" : {
              "url": "https://staging-mc.kb.us-east-1.aws.found.io:9243/api/reporting/generate/printablePdfV2?jobParams=%28browserTimezone%3AEurope%2FLondon%2Clayout%3A%28dimensions%3A%28height%3A484%2Cwidth%3A2240%29%2Cid%3Aprint%29%2ClocatorParams%3A%21%28%28id%3ADASHBOARD_APP_LOCATOR%2Cparams%3A%28dashboardId%3Acac77490-a11f-11ec-b343-85a4ccf2c798%2Cfilters%3A%21%28%28%27%24state%27%3A%28store%3AappState%29%2Cmeta%3A%28alias%3A%21n%2Cdisabled%3A%21f%2Cindex%3Ab5f332d0-43c7-11ec-b5ab-fbc66f2b8ddf%2Ckey%3Aplace%2Cnegate%3A%21f%2Cparams%3A%21%28Arista%29%2Ctype%3Aphrases%29%2Cquery%3A%28bool%3A%28minimum_should_match%3A1%2Cshould%3A%21%28%28match_phrase%3A%28place%3AArista%29%29%29%29%29%29%29%2CpreserveSavedFilters%3A%21t%2CtimeRange%3A%28from%3Anow-24h%2Cto%3Anow%29%2CuseHash%3A%21f%2CviewMode%3Aview%29%2Cversion%3A%278.0.0%27%29%29%2CobjectType%3Adashboard%2Ctitle%3A%27PM2.5%20REPORT%27%2Cversion%3A%278.0.0%27%29",
              "retries":40, 
              "interval":"15s", 
              "auth":{ 
                "basic":{
                  "username":"angad",
                  "password":"xxxx"
                }
              }
            }
          }
        }
      }
    }
  }
}

```

Regards

Angad

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 28, 2022, 7:58am UTC](https://discuss.elastic.co/t/dynamic-date-to-watcher-email/300687/2 "2022-03-28T07:58:18Z")

</div>

Hey,

that field is not dynamic and cannot be scripted unfortunately. Feel free to open an issue in the Elasticsearch repo as a feature request.

--Alex

---

<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:** [April 25, 2022, 7:59am UTC](https://discuss.elastic.co/t/dynamic-date-to-watcher-email/300687/3 "2022-04-25T07:59:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TomonoriSoejima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomonorisoejima/32/33182_2.png) [@TomonoriSoejima](https://discuss.elastic.co/u/TomonoriSoejima)\
**Post date:** [December 23, 2022, 8:57am UTC](https://discuss.elastic.co/t/dynamic-date-to-watcher-email/300687/4 "2022-12-23T08:57:49Z")

</div>

Looks like this issue is filed for a request.

> <https://github.com/elastic/elasticsearch/issues/34468>
>
> \<!--
> 
> \*\* Please read the guidelines below. \*\*
> 
> Issues that do not follow the…se guidelines are likely to be closed.
> 
> 1. GitHub is reserved for bug reports and feature requests. The best place to
> ask a general question is at the Elastic \[forums\](https://discuss.elastic.co).
> GitHub is not the place for general questions.
> 
> 2. Is this bug report or feature request for a supported OS? If not, it
> is likely to be closed. See https://www.elastic.co/support/matrix#show\_os
> 
> 3. Please fill out EITHER the feature request block or the bug report block
> below, and delete the other block.
> 
> \--\>
> 
> 
> 
> \*\*Describe the feature\*\*:
> 
> 
> 
> \*\*Elasticsearch version\*\* (\`bin/elasticsearch --version\`):6.2.0
> 
> \*\*Description of the problem including expected versus actual behavior\*\*:
> 
> \-enhancement request is to allow dynamic naming capability for attachments to emails generated by watcher. Specifically, the need is to append a date as a suffix to the attachment name. This strikes me as a reasonable capability with obvious utility. 
> 
> \-as far as I am aware, there is no such capability at this time, and the only workaround is to manually rename the attachment file once it has been received.
