[feature] conditional filter #3

Closed
abarre opened this Issue Sep 26, 2012 · 0 comments

Comments

Projects
None yet
2 participants

abarre commented Sep 26, 2012

It's necessary to have a conditional filter that will send the data to the output only if the test pass.

I think that the best solution should be to be able to write a callback in javascript code, for instance :

function (msg, fields) {
   return parseInt(fields['status'], 10) >= 400
}

Means : only keep the ligne with a status superior to 400.

A callback permits to write the needed logic.

For the url api,

It becomes :

filters://keep_only_if?test=status_superior_to_400

and in the file status_superior_to_400:

parseInt(fields['status'], 10) >= 400

Note : we should be able to add a conditional filter only for an output, not necessary all the output.

So, maybe :

output://statsd://ip?only_if=status_superior_to_400

bpaquet closed this in bcb4f01 Oct 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment