Skip to content

Potential fix for #31 - define 'res' as empty list, when it's not being created due to empty SPL search results#32

Open
BartekZm wants to merge 1 commit intosplunk:mainfrom
BartekZm:main
Open

Potential fix for #31 - define 'res' as empty list, when it's not being created due to empty SPL search results#32
BartekZm wants to merge 1 commit intosplunk:mainfrom
BartekZm:main

Conversation

@BartekZm
Copy link

Potential fix for #31 - define 'res' as empty list, when it's not being created due to empty SPL search results:
slack_alerts/bin:

(...)
def build_fields_attachment(payload):  
    res = payload.get('result', dict())                                        
    if not res:                                                                
       res = {}                                                  
    available_fields = list(res.keys()) 
(...)

It addresses the problem in my test environment in context of the issue #31 and I observed no impact on the behavior & additional for other sample alerts and how they're performed. Yet, please perform any additional tests when needed (I have no dev background & experience).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant