Replace Field Values - Type Conversion


(coder lol) #1

Considering this event:

{"@version":"1","@timestamp":"2015-09-20T06:45:03.613Z","contextMap":{"sourceline":"500"},"source":{"class":"myClass","method":"myMethod","file":"myFile.java","line":100}}

[source][line] is an integer
[contextMap][sourceline] is a string

Given this mutate filter:
mutate {
replace => { "[source][line]" => "%{[contextMap][sourceline]}" }
}

Would the [contextMap][sourceline] value be converted to an integer automatically?

Thanks...


(Magnus B├Ąck) #2

No. A field doesn't have a data type of its own. If you assign a string value to a field then it'll be a string after the assignment too. Same with integers.


(system) #3