TomonoriSoejima / Tejun

notes related to working cases
5 stars 3 forks source link

dissect test in inget pipeline #36

Open TomonoriSoejima opened 4 years ago

TomonoriSoejima commented 4 years ago
POST /_ingest/pipeline/_simulate
{
  "pipeline" :
  {
    "description": "_description",
    "processors": [
      {
  "dissect": {
    "field": "message",
    "pattern" : "[%{}] %{timestamp->}/%{+timestamp->}/%{+timestamp->} %{+timestamp} %{etc}"
   }
      }
    ]
  },
  "docs": [
    {
      "_index": "hello",
      "_id": "id1",
      "_source": {
        "message": "[  info ] 2020/08/27 23:58:16.85 Task end --"
      }
    }
  ]
}

- response

{
  "docs" : [
    {
      "doc" : {
        "_index" : "hello",
        "_type" : "_doc",
        "_id" : "id1",
        "_source" : {
          "message" : "[  info ] 2020/08/27 23:58:16.85 Task end --",
          "etc" : "Task end --",
          "timestamp" : "2020082723:58:16.85"
        },
        "_ingest" : {
          "timestamp" : "2020-09-08T01:03:56.072242Z"
        }
      }
    }
  ]
}
POST /_ingest/pipeline/_simulate
{
  "pipeline": {
    "description": "_description",
    "processors": [
      {
        "dissect": {
          "field": "message",
          "pattern": "[%{}] %{timestamp->} %{+timestamp->} %{etc}"
        }
      }
    ]
  },
  "docs": [
    {
      "_index": "hello",
      "_id": "id1",
      "_source": {
        "message": "[  info ] 2020/08/27 23:58:13.97 Task start --"
      }
    }
  ]
}

- response

{
  "docs" : [
    {
      "doc" : {
        "_index" : "hello",
        "_type" : "_doc",
        "_id" : "id1",
        "_source" : {
          "message" : "[  info ] 2020/08/27 23:58:13.97 Task start --",
          "etc" : "Task start --",
          "timestamp" : "2020/08/2723:58:13.97"
        },
        "_ingest" : {
          "timestamp" : "2020-09-08T01:05:15.358512Z"
        }
      }
    }
  ]
}