Multiple template in the statsD plugin only taking first value and ignores rest template pattern

telegraf
#1

Relevant telegraf.conf:

templates = [
         "service.method.url.status.measurement.field",
         "service.measurement.measurement.measurement",
         "service.measurement.measurement",
         "service.measurement"
     ]

System info:
Linux thinkpad-e470 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 12:56:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

 telegraf --version
Telegraf v1.6.3 (git: release-1.6 890f1d3a)

Steps to reproduce:

$ echo "foo.test.test.bar:7|c" | nc -u -w0 127.0.0.1 8125
$ echo "foo.test.test:1|c" | nc -u -w0 127.0.0.1 8125
$ echo "foo.post.hi.200.http.duration:3|c" | nc -u -w0 127.0.0.1 8125

First two measurements are never created in the influx db it only create the the last measurement of http matching the first template pattern.

If i remove the first pattern from template it then creates all the value in the influx db of the remaining pattern

May 24 13:28:50 thinkpad-e470 telegraf[25956]: 2018-05-24T07:58:50Z D! Output [influxdb] buffer fullness: 0 / 10000 metrics.
May 24 13:29:00 thinkpad-e470 telegraf[25956]: 2018-05-24T07:59:00Z D! Output [influxdb] buffer fullness: 1 / 10000 metrics.
May 24 13:29:00 thinkpad-e470 influxd[1704]: [httpd] 127.0.0.1 - - [24/May/2018:13:29:00 +0530] "POST /write?db=service_metrics&rp=four_week_only HTTP/1.1" 204 0 "-" "telegraf" 515ab461-5f28-11e8-81d3-000000000000 3268
May 24 13:29:00 thinkpad-e470 telegraf[25956]: 2018-05-24T07:59:00Z D! Output [influxdb] wrote batch of 1 metrics in 5.077236ms
May 24 13:29:10 thinkpad-e470 telegraf[25956]: 2018-05-24T07:59:10Z D! Output [influxdb] buffer fullness: 0 / 10000 metrics.

May 24 13:29:20 thinkpad-e470 telegraf[25956]: 2018-05-24T07:59:20Z D! Output [influxdb] buffer fullness: 1 / 10000 metrics.
May 24 13:29:20 thinkpad-e470 influxd[1704]: [httpd] 127.0.0.1 - - [24/May/2018:13:29:20 +0530] "POST /write?db=service_metrics&rp=four_week_only HTTP/1.1" 204 0 "-" "telegraf" 5d465bf8-5f28-11e8-81d4-000000000000 4423
May 24 13:29:20 thinkpad-e470 telegraf[25956]: 2018-05-24T07:59:20Z D! Output [influxdb] wrote batch of 1 metrics in 5.538427ms
May 24 13:29:30 thinkpad-e470 telegraf[25956]: 2018-05-24T07:59:30Z D! Output [influxdb] buffer fullness: 0 / 10000 metrics.

Can anyone over here can guide me what i’m doing wrong in the template pattern ? and what is the correct approach