Exemple #1
0
 /**
     Adds an array to the seriesOverrides field and checks for leading slashes.
     **/
 public function addToSeriesOverrides(array $data)
 {
     if (\histou\helper\str::isRegex($data['alias'])) {
         $data['alias'] = '/' . str_replace('/', '\\/', $data['alias']) . '/';
     }
     array_push($this->data['seriesOverrides'], $data);
 }
 /**
     Creates filter tags array based on host, service...
     **/
 private function createFilterTags(array $filterTags = array())
 {
     $tags = array();
     $i = 0;
     foreach ($filterTags as $key => $value) {
         foreach ($value as $type => &$typeValue) {
             //Used for Backslash in tag value
             if (!\histou\helper\str::isRegex($typeValue)) {
                 $typeValue = str_replace('\\', '\\\\', $typeValue);
             }
         }
         $condition = array_key_exists('condition', $value) ? $value['condition'] : 'AND';
         $operator = array_key_exists('operator', $value) ? $value['operator'] : '=';
         if ($i == 0) {
             array_push($tags, array('key' => $key, 'operator' => $operator, 'value' => $value['value']));
         } else {
             array_push($tags, array('condition' => $condition, 'key' => $key, 'operator' => $operator, 'value' => $value['value']));
         }
         $i++;
     }
     return $tags;
 }