I use Graylog 3.3.8 and I’d like to send slack notifications with the permalink.
${foreach backlog message}https://my_domain/messages/${message.index}/${message.id}
I’ve read this documentation Alerts — Graylog 3.3.8 documentation  and found “index” in the backlog section!
But when the slack notification is sent, I receive this error message 
That is suspicious because message.id is working
How can I get an index from the message to create permalink?
             
            
              
            
           
          
            
              
                shoothub  
              
                  
                    April 27, 2021,  2:55pm
                   
                  2 
               
             
            
              Try to use correct format ${message.index} so $ before {
             
            
              
            
           
          
            
            
              I wrote in correct format, but for some reason ‘$’ was hidden on this site
Also I put ${message} here http://joxi.ru/Vrw9vjas4LVX52  (it’s forbidden to upload txt files)
             
            
              
            
           
          
            
              
                gsmith  
                
                  
                    April 27, 2021, 11:05pm
                   
                  4 
               
             
            
              @IlyaUhlianitsa 
Hello,
--- [Event Definition] ---------------------------
Title:       ${event_definition_title}
Description: ${event_definition_description}
Type:        ${event_definition_type}
--- [Event] --------------------------------------
Timestamp:            ${event.timestamp}
Message:              ${event.message}
Source:               ${event.source}
Priority:             ${event.priority}
Alert:                ${event.alert}
Timestamp Processing: ${event.timestamp}
Timerange Start:      ${event.timerange_start}
Timerange End:        ${event.timerange_end}
Stream URL:           ${event.stream_name}          
${if stream_url}Stream URL: ${stream_url}${end}
${if backlog}
--- [Backlog] ------------------------------------
Last messages accounting for this alert:
${foreach backlog message}
https://graylog.domain.com:9000/messages/${message.index}/${message.id}
User:             ${message.fields.TargetUserName}
WorkStation Name:  ${message.fields.WorkstationName}
Event Time:       ${message.fields.EventReceivedTime}
Source:           ${message.source}
Logon Type:       ${message.LogonType}
---[backlog end]---------------------------------
${end}
${end}
And I received this.
             
            
              
            
           
          
            
            
              Glad to hear it helped you!
             
            
              
            
           
          
            
              
                shoothub  
              
                  
                    April 28, 2021,  7:40am
                   
                  6 
               
             
            
              Just use online editor to format code correctly using ```code``` and read FAQ how to post comments:https://community.graylog.org/faq 
             
            
              
            
           
          
            
            
              Thanks, I’ve edited the comment, looks good.
             
            
              
            
           
          
            
              
                shoothub  
              
                  
                    April 28, 2021,  8:51am
                   
                  8 
               
             
            
              
Do you post only extract of your message template? Because I don’t see ${end} of forearch loop.
${foreach backlog message}https://my_domain/messages/${message.index}/${message.id}${end}
 
            
              
            
           
          
            
            
              There is a full template
##########
Alert Description: ${check_result.resultDescription}
Date: ${check_result.triggeredAt}
${if backlog}Last messages accounting for this alert:
${foreach backlog message}https://my_domain/messages/${message.index}/${message.id}
${end}${else}<No backlog>
${end}
 
            
              
            
           
          
            
              
                shoothub  
              
                  
                    April 28, 2021, 10:34am
                   
                  10 
               
             
            
              I don’t know if the message in same line as if can’t create problem, try to format it in separate line as:
##########
Alert Description: ${check_result.resultDescription}
Date: ${check_result.triggeredAt}
${if backlog}
Last messages accounting for this alert:
${foreach backlog message}
https://my_domain/messages/${message.index}/${message.id}
${end}
${else}<No backlog>
${end}
 
            
              
            
           
          
            
            
              No, without ${message.index} part everything is working. I attached screenshot above where your can see that index not exists in message object. I can use message.source, message.id, message.message, but not message.index, because it is not there.
             
            
              
            
           
          
            
              
                shoothub  
              
                  
                    April 28, 2021,  1:53pm
                   
                  12 
               
             
            
              Maybe it’s problem with slack notification. Did you try to use same notification template with Email notification?
I can’t check because I use graylog 4.0.
Maybe it’s been already fixed in newer version of 3.3 (latest is 3.3.12):https://docs.graylog.org/en/3.3/pages/changelog.html 
Best way to test is to download OVA a configure simple setup and test:https://docs.graylog.org/en/3.3/pages/installation/virtual_machine_appliances.html 
             
            
              
            
           
          
            
              
                gsmith  
              
                  
                    April 28, 2021,  9:16pm
                   
                  13 
               
             
            
              Hello,
             
            
              
            
           
          
            
            
              Good catch! An email notification is working
             
            
              
            
           
          
            
              
                system  
              
                  
                    May 13, 2021, 10:43am
                   
                  15 
               
             
            
              This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.