<commit_before>#!/bin/bash
#
# ELK Manager 
#

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

source "${DIR}/set-elk-env.sh"
source "${DIR}/elk-utils.sh"

set_logs_paths()
{
  echo "Set logs paths..."
  sed -i "/path.logs/c\path.logs: ${ELK_LOGS}" $ELASTICSEARCH_HOME/config/elasticsearch.yml
  sed -i "/path.logs/c\path.logs: ${ELK_LOGS}" $LOGSTASH_HOME/config/logstash.yml
  sed -i "/logging.dest/c\logging.dest: ${ELK_LOGS}/kibana.log" $KIBANA_HOME/config/kibana.yml
  echo "Logs paths correctly set"
}

init_jvm_options()
{
  sed -i -e "s~@ELK_LOGS@~$ELK_LOGS~g" $ELASTICSEARCH_HOME/config/jvm.options
  sed -i -e "s~@ELK_LOGS@~$ELK_LOGS~g" $LOGSTASH_HOME/config/jvm.options
}

init_elasticsearch()
{
  echo "network.host: 0.0.0.0" >> $ELASTICSEARCH_HOME/config/elasticsearch.yml
  echo "discovery.type: single-node" >> $ELASTICSEARCH_HOME/config/elasticsearch.yml
  cd $ELASTICSEARCH_HOME
  echo "Starting Elasticsearch..."<commit_msg>Fix ELK several inits<commit_after>#!/bin/bash
#
# ELK Manager 
#

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

source "${DIR}/set-elk-env.sh"
source "${DIR}/elk-utils.sh"

set_logs_paths()
{
  echo "Set logs paths..."
  sed -i "/path.logs/c\path.logs: ${ELK_LOGS}" $ELASTICSEARCH_HOME/config/elasticsearch.yml
  sed -i "/path.logs/c\path.logs: ${ELK_LOGS}" $LOGSTASH_HOME/config/logstash.yml
  sed -i "/logging.dest/c\logging.dest: ${ELK_LOGS}/kibana.log" $KIBANA_HOME/config/kibana.yml
  echo "Logs paths correctly set"
}

init_jvm_options()
{
  sed -i -e "s~@ELK_LOGS@~$ELK_LOGS~g" $ELASTICSEARCH_HOME/config/jvm.options
  sed -i -e "s~@ELK_LOGS@~$ELK_LOGS~g" $LOGSTASH_HOME/config/jvm.options
}

init_elasticsearch()
{
  if ! grep -q 'network.host: 0.0.0.0' $ELASTICSEARCH_HOME/config/elasticsearch.yml; then
    echo "network.host: 0.0.0.0" >> $ELASTICSEARCH_HOME/config/elasticsearch.yml
    echo "discovery.type: single-node" >> $ELASTICSEARCH_HOME/config/elasticsearch.yml
  fi
  cd $ELASTICSEARCH_HOME
  echo "Starting Elasticsearch..."
{'fraction_non_alphanumeric': 0.17773339990014977, 'fraction_numerical': 0.006989515726410384, 'mean_word_length': 4.460490463215259, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '2958581', 'n_tokens_mistral': 868, 'n_tokens_neox': 853, 'n_words': 134}