graylog-labs / graylog-plugin-rundeck

Graylog alarm callback plugin for Rundeck
Apache License 2.0
3 stars 1 forks source link

Job Arguments not working #4

Open MarkusEckerl opened 7 years ago

MarkusEckerl commented 7 years ago

Environment: Graylog 2.2.2 (Linux - Java 8) It is not possible to pass arguments from graylog to rundeck using the rundeck alarm callback. For example it is simply impossible to pass the full message from graylog as an argument.

joschi commented 7 years ago

@MarkusEckerl Which version of Graylog, which version of this plugin, and which version of Rundeck are you using?

MarkusEckerl commented 7 years ago

Hi,

thank you for this fast answer.

Graylog: 2.2.2+691b4b7 (the last one..)

Plugin: 1.1.1

Rundeck: 2.7.1-1

Am 06.03.2017 um 16:37 schrieb Jochen Schalanda:

@MarkusEckerl https://github.com/MarkusEckerl Which version of Graylog, which version of this plugin, and which version of Rundeck are you using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Graylog2/graylog-plugin-rundeck/issues/4#issuecomment-284432109, or mute the thread https://github.com/notifications/unsubscribe-auth/AZAcVz4yvMb8KdPjrzG6nb-3O9SwjE5zks5rjChJgaJpZM4MUCOC.

joschi commented 7 years ago

@MarkusEckerl How exactly did you configure the Rundeck plugin and what's the definition (XML or YAML) of the Rundeck job?

Also, did you see the "Field arguments" setting of the Rundeck plugin? This basically can be used to pass any message field as job parameter named like the field (e. g. the "full_message" parameter would include the value of the "full_message" field).

FireHelmet commented 7 years ago

Hello @joschi and @MarkusEckerl,

I'm facing same issue, my graylog server is 2.2.3 with your plugin in version 1.2.1 and Rundeck 2.8.2.

My callback is configured like:

image

and the job is well called by Graylog but the value is the variable instead of the real value of message field "param1":

In rundeck: image

In Graylog: image

Thank you for your support.

joschi commented 7 years ago

@FireHelmet That's pretty much working as intended. The "Job arguments" field doesn't support templating, so your configuration will literally send ServiceDisplayName:${message.param1} to your Rundeck job.

See https://github.com/graylog-labs/graylog-plugin-rundeck/blob/1.2.1/README.md#job-arguments for details.

FireHelmet commented 7 years ago

@joschi,

Thank you for your answer but I don't understand completely. Could you write an example of each option (job arguments and field arguments ) ? Because I have also tried some other syntax but without sucess.

Thanks again ! And thank you for this plugin !

joschi commented 7 years ago

@FireHelmet We are using GitHub issues for tracking bugs in Graylog itself, but this doesn't look like one. Please post this issue to our discussion forum or join the #graylog channel on freenode IRC.

Thank you!

FireHelmet commented 7 years ago

@joschi

I have tested like you have requested on IRC but the field sent to Rundeck appear blank when is it executed by Rundeck. How can I send you some logs or anything can help you to debug this ?

I really need this option :). In addition, I can do some tests if it's requested :)

Thank you

FireHelmet commented 7 years ago

@joschi

As requested on IRC, I'm posting some additionnal informations:

My Graylog message with the field "param1" (I need to pass the content of this field to rundeck):

image

My Graylog Alert notification config:

image

My rundeck job definition: image

image

The job is correctly called by graylog:

image

But the content field via Rundeck is blank !:

image

Could you help ?

Thank you,

FireHelmet commented 7 years ago

@joschi

I have found, it's working well now !

On graylog, you need to send the backlog message when an alert is triggered. So,

  1. Open your alert condition
  2. Write "1" in message backlog field: image
  3. Save

Joschi, please, could you modify the Readme of your plugin to include this information because it's a requirement.

Thanks !