Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'triggered_condition' of undefined #1

Open
mike-kll opened this issue Jan 31, 2021 · 1 comment
Open

Cannot read property 'triggered_condition' of undefined #1

mike-kll opened this issue Jan 31, 2021 · 1 comment

Comments

@mike-kll
Copy link

Hello everybody,

My environment:

  • Rocket Chat V. 3.10.4
  • Node-Version v12.18.4
  • Graylog 4.0

I have Integration the Script in Rocket Chat and configured Graylog to send Webhook.

When I send a test message from Graylog I get the following error message.

I20210131-11:22:08.866(1) server.js:204 Integrations ➔ Incoming WebHook.error [Error running Script in Trigger rocketchat-graylog-hook :]
I20210131-11:22:08.867(1) server.js:204 Integrations ➔ Incoming WebHook.error var GRAYLOG_URL="https://graylog.xxxx.xx";var createPermalink=function(m,index){var label=index===0?"Display complete message":"#"+(index+1);return""+label+""};var formatMessages=function(messages){var grouped=messages.reduce(function(acc,m){if(!acc.hasOwnProperty(m.message)){acc[m.message]=[]}acc[m.message].push(m);return acc},{});var result=[];for(var mType in grouped){if(grouped.hasOwnProperty(mType)){var line="Message: "+mType+"
Source: "+grouped[mType][0].source+"
"+grouped[mType].map(createPermalink).join(", ");result.push(line)}}return result.join("
-------------
")};var parseText=function(result){if(result.matching_messages.length>0){return formatMessages(result.matching_messages)}else{return result.result_description}};var createAlertMessageEvent=function(result){return":warning: Alert: "+result.triggered_condition.title+"
"+parseText(result)};var makeAttachment=function(text){return{text:text,color:"#e8d612"}};var Script=function(){function Script(){}var _proto=Script.prototype;_proto.process_incoming_request=function process_incoming_request(_ref){var request=_ref.request;return{content:{attachments:[makeAttachment(createAlertMessageEvent(request.content.check_result))]}}};return Script}();

I20210131-11:22:08.869(1) server.js:204 Integrations ➔ Incoming WebHook.error [Stack:]
I20210131-11:22:08.870(1) server.js:204 Integrations ➔ Incoming WebHook.error Error: TypeError: Cannot read property 'triggered_condition' of undefined at evalmachine.:11:33 at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40

Does someone have an idea what the problem is?

Greetings

Mike

@mike-kll
Copy link
Author

I think the problem is the Payload in Graylog 4 is different to Graylog 3.

https://docs.graylog.org/en/4.0/pages/alerts.html

https://docs.graylog.org/en/3.0/pages/streams/alerts.html?highlight=alerts#http-alert-notification

Can someone help me with this problem?

Greetings

Mike

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

No branches or pull requests

1 participant