Pipeline help convert field numeric field

I am working on getting a field converted from string to numeric. it always comes in as a number but it is set as a string

i created a rule to convert it, but it doesn’t make any changes to the targeted logs. any help creating this pipeline would be very appreciated!

Pipeline rule

rule “IIS time-taken convert”
when has_field(“time-taken”)

then
//Converts the time-taken to a numeric field
set_field(“time-taken”, to_long($message.time-taken));
end

targeted field

image

Your field was previously mapped as string in elastic, so no convert can help. You need to either rotate index, or create custom index mapping for field.

https://docs.graylog.org/en/3.2/pages/configuration/elasticsearch.html#custom-index-mappings

1 Like

Ah okay, i thought you could do that with Pipelines!
i found another way, in Nxlog i could make that field send as a integer so when graloy gets it, its Long

Thanks again! you post helped me go the right direction!

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