congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AlertStreamEvent.getSeverity
Code IndexAdd Tabnine to your IDE (free)

How to use
getSeverity
method
in
org.apache.eagle.alert.engine.model.AlertStreamEvent

Best Java code snippets using org.apache.eagle.alert.engine.model.AlertStreamEvent.getSeverity (Showing top 3 results out of 315)

origin: apache/eagle

alertContext.put(PublishConstants.ALERT_EMAIL_ALERT_DATA_DESC, generateAlertDataDesc(event));
alertContext.put(PublishConstants.ALERT_EMAIL_ALERT_CATEGORY, event.getCategory());
alertContext.put(PublishConstants.ALERT_EMAIL_ALERT_SEVERITY, event.getSeverity().toString());
alertContext.put(PublishConstants.ALERT_EMAIL_TIME, String.format("%s %s",
    DateTimeUtil.millisecondsToHumanDateWithSeconds(event.getCreatedTime()),
origin: apache/eagle

public AlertEntity convertAlertEvent(AlertStreamEvent event) {
  Preconditions.checkNotNull(event.getAlertId(), "alertId is not initialized before being published: " + event.toString());
  AlertEntity alertEvent = new AlertEntity();
  Map<String, String> tags = new HashMap<>();
  tags.put(POLICY_ID_KEY, event.getPolicyId());
  tags.put(ALERT_ID_KEY, event.getAlertId());
  tags.put(ALERT_CATEGORY, event.getCategory());
  tags.put(ALERT_SEVERITY, event.getSeverity().toString());
  String host = event.getDataMap().getOrDefault("host", "null").toString();
  String hostname = event.getDataMap().getOrDefault("hostname", "null").toString();
  if (host != "null") {
    tags.put(ALERT_HOST, host);
  } else {
    tags.put(ALERT_HOST, hostname);
  }
  if (event.getContext() != null && !event.getContext().isEmpty()) {
    tags.put(SITE_ID_KEY, event.getContext().get(SITE_ID_KEY).toString());
    alertEvent.setPolicyValue(event.getContext().get(POLICY_VALUE_KEY).toString());
    alertEvent.setAppIds((List<String>) event.getContext().get(APP_IDS_KEY));
  }
  alertEvent.setTimestamp(event.getCreatedTime());
  alertEvent.setAlertData(event.getDataMap());
  alertEvent.setAlertSubject(event.getSubject());
  alertEvent.setAlertBody(event.getBody());
  alertEvent.setTags(tags);
  return alertEvent;
}
origin: apache/eagle

if (event.getCategory() != null) {
  email.setSubject(String.format("[Eagle Alert][%s][%s] %s",
    event.getSeverity(), event.getCategory(), event.getSubject() != null ? event.getSubject() : subject));
} else {
  email.setSubject(String.format("[Eagle Alert][%s] %s",
    event.getSeverity(), event.getSubject() != null ? event.getSubject() : subject));
org.apache.eagle.alert.engine.modelAlertStreamEventgetSeverity

Popular methods of AlertStreamEvent

  • ensureAlertId
  • getAlertId
  • getBody
  • getCreatedTime
  • getPolicyId
  • getSubject
  • setData
  • toString
  • <init>
  • getContext
  • getData
  • getDataMap
  • getData,
  • getDataMap,
  • getStreamId,
  • setContext,
  • setCreatedTime,
  • setPolicyId,
  • setSchema,
  • setStreamId,
  • setTimestamp,
  • getCategory

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • JCheckBox (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now