# Help Needed with Graylog Pipeline - Conversion Issue

**URL:** https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714
**Category:** Graylog Central (peer support)
**Tags:** pipeline-rules
**Created:** [June 13, 2024, 9:52am UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714 "2024-06-13T09:52:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![sziegle](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/sziegle/32/16843_2.png) [@sziegle](https://community.graylog.org/u/sziegle)
#### Post date: [June 13, 2024, 9:52am UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/1 "2024-06-13T09:52:59Z")

</div>

Hi everyone,

I’m encountering an issue in Graylog with a pipeline that has two rules:

**Stage 6**

```auto
rule "rtpengine mos"
when
  contains(
  value: to_string($message."message"),
  search: "Average MOS"
)
then
  let gl2_fragment_grok_results = grok(
  pattern: "%{SYSLOGTIMESTAMP} %{SYSLOGHOST} %{SYSLOGPROG}: %{WORD:loglevel}: \\[%{DATA:call_id}(@%{DATA:cloud_ip}(:%{POSINT})?)?\\]:( \\[%{WORD}?\\])? ------ Average MOS %{BASE16FLOAT:average_mos}, lowest MOS %{BASE16FLOAT:lowest_mos} \\(at %{SECOND:start}\\), highest MOS %{BASE16FLOAT:highest_mos} \\(at %{SECOND:start2}\\)",
  value: to_string($message."message")
);
set_fields(
  fields: gl2_fragment_grok_results
);
end

```

**Stage 7**

```auto
rule "convert average_mos to numeric"
when
  has_field("average_mos")
then
  let averageMosString = to_string($message.average_mos);
  let averageMosNumeric = to_double(averageMosString);
  set_field("average_mos_num", averageMosNumeric);
end

```

**Summary:**

In Stage 6, the variable `average_mos` is created as a string. In Stage 7, `average_mos` is copied to a new field `average_mos_num`, which is then supposed to be converted to a double.

However, the issue I’m facing is that `average_mos_num` remains a string instead of being converted to a double.

Has anyone experienced a similar issue or have any suggestions on how to resolve this? Your help would be greatly appreciated!

Thank you!

---

<div class="post-metadata">

### Author: ![patrickmann](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/patrickmann/32/9091_2.png) [@patrickmann](https://community.graylog.org/u/patrickmann)
#### Post date: [June 14, 2024, 9:57am UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/2 "2024-06-14T09:57:55Z")

</div>

Sounds like an issue with dynamic field types.  
If you rotate the index, does the problem persist?

---

<div class="post-metadata">

### Author: ![sziegle](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/sziegle/32/16843_2.png) [@sziegle](https://community.graylog.org/u/sziegle)
#### Post date: [June 17, 2024, 8:53am UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/3 "2024-06-17T08:53:21Z")

</div>

Under “Configure Filebeat Field Types,” I select the field name and change the type, and I, of course, check the box for immediate rotation. However, when I search for the field name under /search/Fields, it still shows the type as STRING!

---

<div class="post-metadata">

### Author: ![sziegle](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/sziegle/32/16843_2.png) [@sziegle](https://community.graylog.org/u/sziegle)
#### Post date: [June 17, 2024, 8:55am UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/4 "2024-06-17T08:55:39Z")

</div>

If I change the field name from:`average_mos_num -> averagemosnum`  
,then the type is recognized correctly.

---

<div class="post-metadata">

### Author: ![patrickmann](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/patrickmann/32/9091_2.png) [@patrickmann](https://community.graylog.org/u/patrickmann)
#### Post date: [June 17, 2024, 10:10am UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/5 "2024-06-17T10:10:15Z")

</div>

Changing the name is another way of dealing with wrong type mapping.  
Since the name is new, the type is newly assigned.

---

<div class="post-metadata">

### Author: ![sziegle](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/sziegle/32/16843_2.png) [@sziegle](https://community.graylog.org/u/sziegle)
#### Post date: [June 18, 2024, 8:16am UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/6 "2024-06-18T08:16:58Z")

</div>

If I create a new variable with the name ‘average\_num’, the type remains an integer. If I create the variable ‘averagenum’, then the type can be selected.

---

<div class="post-metadata">

### Author: ![patrickmann](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/patrickmann/32/9091_2.png) [@patrickmann](https://community.graylog.org/u/patrickmann)
#### Post date: [June 18, 2024, 12:06pm UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/7 "2024-06-18T12:06:39Z")

</div>

On the left edge of the search screen is a Button that is labeled “X1”. Click it to see all the currently known field names and their type.  
My guess is that `average_num` was already used. Double-check that you are using a previously unknown name.  
I’d be very surprised if there was an issue with the underscore in a name, since it is so widely used.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/3/3/33e0440e21209b0ffdaf97c3a7770c0103707e08.png)

---

<div class="post-metadata">

### Author: ![sziegle](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/sziegle/32/16843_2.png) [@sziegle](https://community.graylog.org/u/sziegle)
#### Post date: [June 27, 2024, 1:59pm UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/8 "2024-06-27T13:59:17Z")

</div>

I have now created a completely new variable and now it seems to be working, very strange, but thanks 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [July 11, 2024, 1:59pm UTC](https://community.graylog.org/t/help-needed-with-graylog-pipeline-conversion-issue/32714/9 "2024-07-11T13:59:49Z")

</div>

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