# Grok help needed

**URL:** <https://discuss.elastic.co/t/grok-help-needed/51838>\
**Category:** Logstash\
**Created:** [June 3, 2016, 11:29pm UTC](https://discuss.elastic.co/t/grok-help-needed/51838 "2016-06-03T23:29:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stecino](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@stecino](https://discuss.elastic.co/u/stecino)\
**Post date:** [June 3, 2016, 11:29pm UTC](https://discuss.elastic.co/t/grok-help-needed/51838/1 "2016-06-03T23:29:14Z")

</div>

Hello Everyone,

I have the following record sets int the following format

Bytes pps bps flow

45678 12 1.2 M 1  
2.2 M 12 231 1

I am trying to parse Bytes and bps fields in such a way, so that if it reads the number and M, it will 2.2 and multiply by 10^6, and if sees a decimal just do nothing.

How can do this?

Thanks, in advance

---

<div class="post-metadata">

**Author:** ![stecino](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@stecino](https://discuss.elastic.co/u/stecino)\
**Post date:** [June 6, 2016, 9:12pm UTC](https://discuss.elastic.co/t/grok-help-needed/51838/2 "2016-06-06T21:12:48Z")

</div>

I actually got it working

I actually had to add another column to it Bpp

But in general I had to take care of all 4 combinations. Here is what it looks like if someone is interested

(^%{NUMBER:Bytes}%{SPACE}M%{SPACE} %{NUMBER:pps}%{SPACE}%{NUMBER:bps}%{SPACE}M%{SPACE}%{NUMBER:Bpp}%{SPACE}%{NUMBER:flows}|^%{NUMBER:Bytes}%{SPACE}M%{SPACE}%{NUMBER:pps}%{SPACE}%{NUMBER:bps}%{SPACE}%{NUMBER:Bpp}%{SPACE}%{NUMBER:flows}|^%{NUMBER:Bytes}%{SPACE}%{NUMBER:pps}%{SPACE}%{NUMBER:bps}%{SPACE}M%{SPACE}%{NUMBER:Bpp}%{SPACE}%{NUMBER:flows}|%{NUMBER:Bytes}%{SPACE}%{NUMBER:pps}%{SPACE}%{NUMBER:bps}%{SPACE}%{NUMBER:Bpp}%{SPACE}%{NUMBER:flows})

---

<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:** [July 6, 2017, 4:54am UTC](https://discuss.elastic.co/t/grok-help-needed/51838/3 "2017-07-06T04:54:22Z")

</div>

Closed on July 6, 2017, 4:54am UTC


