question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filter does not act as expected

See original GitHub issue

re: https://github.com/jpmens/mqttwarn/wiki/Filtering

I have a simple filter defined in the [defaults] section of mqttwarn.ini

def logging_filter(topic, message):
  return True

The goal: prove filtering works by denying all messages.

Later in the file, we have:

[logging/hare]
targets = pushover:pam, log:crit, file:mylog
title: SSH login on {hostname}
filter = logging_filter()
format = User {user} logged into {hostname} from {rhost} at {_dthhmmss}

The function should suppress all incoming logging/hare messages.

No logging/hare messages are being suppressed.

EDIT: Change return value to True

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dlangillecommented, Mar 28, 2018

SUCCESS.

I will fix the docs.

1reaction
sumnerboy12commented, Mar 28, 2018

Ah - I missed the fact you have this in your INI file. Functions need to live in a separate functions.py file, which is defined in your INI file. See https://github.com/jpmens/mqttwarn#the-defaults-section.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does the filter() function not return my expected type ...
I think I have a misconception with Typescript. As I understand, after the filter function there will be no undefined in the array....
Read more >
Top N Filter Not Acting as Expected. - Tableau Community
I have tables with 7-10 filters and millions of rows of data, so it's not at all practical to add the filters into...
Read more >
Filter function in Calculate not giving the expected result
Solved: Hi Experts , Filter function in Calculate not giving the expected result. Trying to get the sum of max timekey in each...
Read more >
Task Report with Table Filter does not function as expected
A) When all filters are cleared except for a single selection for Task Appears On, the list of tasks does not include all...
Read more >
Initialize Butterworth Filter - Does not perform as expected?
I am filtering some data using the Point-by-Point Butterworth filter. Every so often I change the input stream to a different sensor.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found