Target daily index in index_payload action

alerting

(Chris Blackwell) #1

Is there a way to target a daily index from Watcher's index_payload action

something like this

"actions" : {
    "index_payload" : { 
    "transform": { ... },
    "index" : {
      "index" : "my-index-{{year}}.{{month}}.{{day}}", 
      "doc_type" : "my-type" 
    }
  }
}

(Alexander Reelsen) #2

Hey,

yes, you can use date math for your index names.

I'll move this over to the watcher forum as well.

--Alex


(Chris Blackwell) #3

ok thanks for the hint.
I managed to find a slightly better reference.
https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html

so that gives an index definition that looks like this

"index": {
  "index": "<my-index-{now/d}>",
  "doc_type": "my-type"
}

(system) #4

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