Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

HTTP code conversion

HTTP code conversion

New Contributor

Hi.

 

Need syntax help to convert HTTP codes that were parsed by Grok to severities (e.g 0-299 => normal etc).

I tried using the following with no success:

 

if {
conditions : [
{ (severity >= 0 && severity <= 299) }
]
then : [
{ setValues {severity : [normal]} }
]
else : [
{
if {
conditions : [
{ (severity >= 300 && severity <= 399) }
]
then : [
{ setValues {severity : [warn]} }
]
else : [
{ setValues {severity : [error]} }
]
}
}
]
}

 

 

1 REPLY 1
Highlighted

Re: HTTP code conversion

Expert Contributor
You'd need to write some java code to express this part: (severity >= 0 && severity <= 299), for example using the "java" morphline command.

Wolfgang.