Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.31k stars 1.05k forks source link

getTriggeredCondition().getDescription() returns title instead of description #8454

Open viandham opened 4 years ago

viandham commented 4 years ago

Expected Behavior

I expect the getTriggeredCondition().getDescription() method to return the description of the event definition, but instead it returns the title, just as getTitle() does.

Current Behavior

getTriggeredCondition().getDescription() returns the exact same thing as getTitle(), i.e. the title.

Possible Solution

(very unfamiliar with Java, haven't been able to dig into the code that far)

Steps to Reproduce (for bugs)

There are surely other ways to reproduce this issue, but this is what I do: (my way obviously requires an opsgenie subscription etc)

  1. git clone the opsgenie graylog notification plugin (https://github.com/opsgenie/opsgenie-graylog-plugin)
  2. in /src/main/java/com/opsgenie/plugin/graylog/OpsGenieGraylogClient.java, the description string is built on line 125
  3. I edit the string to contain the methods in question
      .append("Event title: ").append(checkResult.getTriggeredCondition().getTitle()).append("\n")
      .append("Event description: ").append(checkResult.getTriggeredCondition().getDescription()).append("\n")
  4. Build and install the plugin.
  5. Trigger an event. This results in a description in opsgenie as follows:
    Event title: Andreas testing OpsGenie
    Event description: Andreas testing OpsGenie
  6. However it should be:
    Event title: Andreas testing OpsGenie
    Event description: This is a description

    as that is what is configured in the event definition in graylog.

Context

I'm ultimately trying to get the description of the event to be sent to OpsGenie, so I can provide context information regarding the defined event to the user that is tasked with solving the particular problem.

Your Environment

viandham commented 3 years ago

Hello, any updates? It would be greatly appreciated if this could be fixed in an update.

Thanks