# Convert fieldtype from neflow protocol .uint8

**URL:** <https://discuss.elastic.co/t/convert-fieldtype-from-neflow-protocol-uint8/67873>\
**Category:** Logstash\
**Created:** [December 2, 2016, 3:25pm UTC](https://discuss.elastic.co/t/convert-fieldtype-from-neflow-protocol-uint8/67873 "2016-12-02T15:25:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pereyrdi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pereyrdi/32/12480_2.png) [@pereyrdi](https://discuss.elastic.co/u/pereyrdi)\
**Post date:** [December 2, 2016, 3:25pm UTC](https://discuss.elastic.co/t/convert-fieldtype-from-neflow-protocol-uint8/67873/1 "2016-12-02T15:25:35Z")

</div>

Hi all !  
Im creating new fields from netflow information, for example get the ipaddres and resolve the hostname into another field.

```
      mutate {     
		add_field => { "IPAddress" => "%{host}" } 
		add_field => { "Hostname" => "%{host}" } 
	  }              	  
	  dns {
	    nameserver => ["8.8.8.8"]
		reverse => ["Hostname"]
		action => replace
	  }

```

But when I do an "add\_field =\> { "protocol\_name" =\> "%{protocol}" }" from the protocol field, dont work, it print

"protocol\_name" =\> "%{protocol}" and not the original value.  
should be "protocol\_name" =\> "1"

(in the netflow.yml loof like this  
4:

- :uint8
- :protocol

and the output  
{  
"netflow" =\> {  
"protocol" =\> 1,

Any idea why I cannot get the value from protocol field ?  
Thanks  
Diego

---

<div class="post-metadata">

**Author:** ![pereyrdi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pereyrdi/32/12480_2.png) [@pereyrdi](https://discuss.elastic.co/u/pereyrdi)\
**Post date:** [December 2, 2016, 3:59pm UTC](https://discuss.elastic.co/t/convert-fieldtype-from-neflow-protocol-uint8/67873/2 "2016-12-02T15:59:08Z")

</div>

Done, The correct way is this.

```
 add_field => {"protocol_name" => "%{[netflow][protocol]}"}

```

=)

Diego.

---

<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:** [December 30, 2016, 3:59pm UTC](https://discuss.elastic.co/t/convert-fieldtype-from-neflow-protocol-uint8/67873/3 "2016-12-30T15:59:13Z")

</div>

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