Reply
New Contributor
Posts: 3
Registered: ‎12-20-2015

HTTP code conversion

[ Edited ]

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]} }
]
}
}
]
}

 

 

Cloudera Employee
Posts: 146
Registered: ‎08-21-2013

Re: HTTP code conversion

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

Wolfgang.

Announcements
The Kite SDK is a collection of docs, sample code, APIs, and tools to make Hadoop application development faster. Learn more at http://kitesdk.org.