W.P. McNeill
W.P. McNeill

Reputation: 17076

Elasticsearch Pipeline: One Processor to Many Fields?

I have an Elasticsearch pipeline that runs the same processor on two different fields.

[
  {
    "date": {
      "field": "begin",
      "formats": [
        "M/dd/yy H:mm",
        "M/d/yy H:mm",
        "MM/dd/yy H:mm",
        "MM/d/yy H:mm",
        "M/dd/yy HH:mm",
        "M/d/yy HH:mm",
        "MM/dd/yy HH:mm",
        "MM/d/yy HH:mm"
      ],
      "target_field": "begin",
      "if": "ctx.begin != null"
    }
  },
  {
    "date": {
      "field": "end",
      "formats": [
        "M/dd/yy H:mm",
        "M/d/yy H:mm",
        "MM/dd/yy H:mm",
        "MM/d/yy H:mm",
        "M/dd/yy HH:mm",
        "M/d/yy HH:mm",
        "MM/dd/yy HH:mm",
        "MM/d/yy HH:mm"
      ],
      "target_field": "end",
      "if": "ctx.end != null"
    }
  }
]

This is redundant. Is there any more concise way for me to specify this?

(Additionally, is there some way to capture, say, M/dd/yy H:mm and MM/dd/yy H:mm without writing both patterns out in full?)

Upvotes: 0

Views: 11

Answers (0)

Related Questions