# Truncate cmdline to save bandwith

**URL:** <https://discuss.elastic.co/t/truncate-cmdline-to-save-bandwith/172920>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [March 19, 2019, 9:12am UTC](https://discuss.elastic.co/t/truncate-cmdline-to-save-bandwith/172920 "2019-03-19T09:12:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaem2111](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaem2111/32/24961_2.png) [@kaem2111](https://discuss.elastic.co/u/kaem2111)\
**Post date:** [March 19, 2019, 9:12am UTC](https://discuss.elastic.co/t/truncate-cmdline-to-save-bandwith/172920/1 "2019-03-19T09:12:35Z")

</div>

Hello,

I am using Version 6.6.0 and have some very long system.process.cmdline fieldvalues that I want to truncate within the (metric)beat agent. The only working possibility I know today is to drop the field:

```
processors:
- drop_fields:
    when:
        regexp:
            system.process.cmdline: ".* .* .* .* .* .* .* .* .* .* .* .*" 
    fields: ["system.process.cmdline"]            

```

Do you plan to implement a truncate function?

Alternatively I could also imagine a construct using matching group as an easy to implement, quick win like:

```
processors:
- drop_fields:
    when:
        regexp:
            system.process.cmdline: "(.*) .* (.*) .* .* .* .* .* .* .* .* .*"
                returns: "text: $2 text: $1"
    fields: ["system.process.cmdline"]            

```

Please let me know whether you want me to create a feature request in GitHub with your preferred option.

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [March 22, 2019, 9:40am UTC](https://discuss.elastic.co/t/truncate-cmdline-to-save-bandwith/172920/2 "2019-03-22T09:40:32Z")

</div>

There is a truncate\_field PR in progress right now: [https://github.com/elastic/beats/pull/11297](https://github.com/elastic/beats/pull/11297)  
It still needs a bit of work, but hopefully will be merged and released soon. Does it satisfy your needs? If you have any additional request, feel free to open an issue.

---

<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:** [April 19, 2019, 9:40am UTC](https://discuss.elastic.co/t/truncate-cmdline-to-save-bandwith/172920/3 "2019-04-19T09:40:34Z")

</div>

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