Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
@from(eventtable = "eagle", servicequery = "GenericMetricService[@site == "sandbox"]{*}", host = "localhost", port = "9090")
define table MetricTable(tags object, timestamp long, value double);

@from(eventtable = "eagle", metric = "hadoop.jmx.metric")
define table CPUMetricTable(site string, component string, host string, timestamp long, value double);

@from(eventtable = "eagle", metric = "hadoop.jmx.metric.max")
define table CPUMetricAggTable(site string, component string, host string, timestamp long, value double);
from CPUMetricTable[site == "sandbox" and timestamp > CURRENT_TIME - 0.5h and timestamp < CURRENT_TIME] 
select max(value) as value, component, max(timestamp) as timestamp "hadoop.jmx.metric.max" as metric, groupby component insert into MetricTable;
  • Option 2: Simple using REST Query Service

Code Block
languagesql
define table EagleService (query string, metricName string, pageSize int)
from GenericMetricServiceEagleService[metricName == "hadoop.namenode.capacityusage" and sitequery == "sandbox"] insert into GenericMetricService;
from AlertService[site@site == \"sandbox\"]#window(30 min) select metricName, count() group by metricName {*}" and pageSize == 1000] insert into GenericMetricService;