<commit_before><commit_msg>221133 Check that Log Analyze and Log Management dashboards are installed in kibana<commit_after>#!/bin/bash

# This script checks that a particular dashboard is installed in Kibana on 
# a particular ELK host.
#
# DASHBOARD and  ELK_IP must be passed from the command line
#
# Example to invoke:
# check_for_dashboard.sh -i 172.16.31.10 -d "Log Analyze Dashboard - Logs-From GUI" 
#

# Get the command line options that were passed to the command
source test_options.sh

# Make sure all required options were passed
if [ -z '${DASHBOARD}' ] || [ -z ${ELK_IP} ];
then
   echo "Dashboard and elk ip are required inputs for check_for_dashboard"
   echo "${SYNTAX}"
   exit 1
fi
echo "DASHBOARD:   ${DASHBOARD}"
echo "ELK_IP:      ${ELK_IP}"

# Check for the dashboard
url="http://${ELK_IP}:9200/.kibana/_search?pretty&q=_type:dashboard"
result=`curl $url --silent | grep "${DASHBOARD}"`

if [ -z '${result}' ];
then
  echo "Dashboard ${DASHBOARD} not installed"
  exit 1
else
  echo "Dashboard ${DASHBOARD} is installed"
  exit 0
fi
{'fraction_non_alphanumeric': 0.11163670766319773, 'fraction_numerical': 0.020813623462630087, 'mean_word_length': 4.237623762376238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4319033', 'n_tokens_mistral': 385, 'n_tokens_neox': 365, 'n_words': 128}