# Does dissect processor in beats support greedy/lazy match?

**URL:** <https://discuss.elastic.co/t/does-dissect-processor-in-beats-support-greedy-lazy-match/261616>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 20, 2021, 6:56am UTC](https://discuss.elastic.co/t/does-dissect-processor-in-beats-support-greedy-lazy-match/261616 "2021-01-20T06:56:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cy-zheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cy-zheng/32/81683_2.png) [@cy-zheng](https://discuss.elastic.co/u/cy-zheng)\
**Post date:** [January 20, 2021, 6:56am UTC](https://discuss.elastic.co/t/does-dissect-processor-in-beats-support-greedy-lazy-match/261616/1 "2021-01-20T06:56:00Z")

</div>

I'm using dissect processor to parse a value like  
`/var/log/containers/calico-node-ltx4t_kube-system_calico-node-21e03abb29adcec39f69e3f76c16eb2b3ed4dd1a51675279de5cedc59bdce56b.log`

using tokenizer:`/var/log/containers/%{kube_pod_name}_%{kube_namespace_name}_%{container_name}-%{container_id}.log`

The result is:

```auto
"kube_pod_name": "calico-node-ltx4t",
"container_id": "node-21e03abb29adcec39f69e3f76c16eb2b3ed4dd1a51675279de5cedc59bdce56b"
"kube_namespace_name": "kube-system",
"container_name": "calico",

```

However, the result I expected is:

```auto
"container_id": "21e03abb29adcec39f69e3f76c16eb2b3ed4dd1a51675279de5cedc59bdce56b"
"container_name": "calico-node"

```

Does dissect processor in beats support greedy/lazy match? Like regexp?

---

<div class="post-metadata">

**Author:** ![mtojek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mtojek/32/63863_2.png) [@mtojek](https://discuss.elastic.co/u/mtojek)\
**Post date:** [January 20, 2021, 9:22am UTC](https://discuss.elastic.co/t/does-dissect-processor-in-beats-support-greedy-lazy-match/261616/2 "2021-01-20T09:22:57Z")

</div>

I'm afraid this is an edge case and unfortunately I don't see a nice workaround right now. I think you can open an issue for Beats to let the team discuss/prioritize this issue.

---

<div class="post-metadata">

**Author:** ![cy-zheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cy-zheng/32/81683_2.png) [@cy-zheng](https://discuss.elastic.co/u/cy-zheng)\
**Post date:** [January 20, 2021, 9:50am UTC](https://discuss.elastic.co/t/does-dissect-processor-in-beats-support-greedy-lazy-match/261616/3 "2021-01-20T09:50:25Z")

</div>

> <https://github.com/elastic/beats/issues/23582>
>
> Version: 7.10.2
> Operating System: Ubuntu 16.04
> Discuss Forum URL: https://discuss.elastic.co/t/does-dissect-processor-in-beats-support-greedy-lazy-match/261616
> Steps to Reproduce:
> I'm using dissect processor to parse a value like
> /var/log/containers/calico-node-ltx4t\_kube-system\_calico-node-21e03abb29adcec39f69e3f76c16eb2b3ed4dd1a51675279de5cedc59bdce56b.log
> using tokenizer:/var/log/containers/%{kube\_pod\_name}\_%{kube\_namespace\_name}\_%{container\_name}-%{container\_id}.log
> The result is:
> "kube\_pod\_name":...

Thanks!

---

<div class="post-metadata">

**Author:** ![abev](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@abev](https://discuss.elastic.co/u/abev)\
**Post date:** [January 25, 2021, 4:33pm UTC](https://discuss.elastic.co/t/does-dissect-processor-in-beats-support-greedy-lazy-match/261616/4 "2021-01-25T16:33:17Z")

</div>

I would drop the fields that you don't need

```auto
- drop_fields
        fields: ["kube_pod_name","kube_namespace_name"]

```

---

<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:** [February 22, 2021, 6:33pm UTC](https://discuss.elastic.co/t/does-dissect-processor-in-beats-support-greedy-lazy-match/261616/5 "2021-02-22T18:33:27Z")

</div>

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