<commit_before>#!/bin/sh

# set -x

# Program name: hec_wrapper.sh
# Purpose - stream to Splunk HEC
# Author - <NAME>
# Disclaimer:  this provided "as is".
# Date - June 2014

# Version 1.0.0

# For AIX / Linux / Solaris

#################################################
## 	Your Customizations Go Here            ##
#################################################

# Which type of OS are we running
UNAME=`uname`

# file destination
userarg1=$1

# Splunk sourcetype
userarg2=$2

# Splunk source
userarg3=$3

# APP path discovery
APP="/etc/nmon-logger"

# source default nmon.conf
if [ -f $APP/default/nmon.conf ]; then
	. $APP/default/nmon.conf
fi

# source local nmon.conf, if any

# Search for a local nmon.conf
if [ -f $APP/local/nmon.conf ]; then
	. $APP/local/nmon.conf
fi

# On a per server basis, you can also set in /etc/nmon.conf
if [ -f /etc/nmon.conf ]; then
	. /etc/nmon.conf
fi

# Capture the splunk_http_url
splunk_http_url=`echo $nmon2csv_options | grep -Po "splunk_http_url\s{0,}\K[^\s]*"`

# Capture the splunk_http_token
splunk_http_token=`echo $nmon2csv_options | grep -Po "splunk_http_token\s{0,}\K[^\s]*"`

# Manage FQDN option
echo $nmon2csv_options | grep '--use_fqdn' >/dev/null
if [ $? -eq 0 ]; then
    HOST=`hostname -f`
else
    HOST=`hostname`
fi

############################################
# functions
############################################

# Store stdin
output=""
while read line ; do
	echo "$line" >> ${userarg1}
	case $output in
	"")
	    output="$line"
	    ;;
	*)<commit_msg>Fix fqdn issues<commit_after>#!/bin/sh

# set -x

# Program name: hec_wrapper.sh
# Purpose - stream to Splunk HEC
# Author - <NAME>
# Disclaimer:  this provided "as is".
# Date - June 2014

# Version 1.0.0

# For AIX / Linux / Solaris

#################################################
## 	Your Customizations Go Here            ##
#################################################

# Which type of OS are we running
UNAME=`uname`

# file destination
userarg1=$1

# Splunk sourcetype
userarg2=$2

# Splunk source
userarg3=$3

# APP path discovery
APP="/etc/nmon-logger"

# source default nmon.conf
if [ -f $APP/default/nmon.conf ]; then
	. $APP/default/nmon.conf
fi

# source local nmon.conf, if any

# Search for a local nmon.conf
if [ -f $APP/local/nmon.conf ]; then
	. $APP/local/nmon.conf
fi

# On a per server basis, you can also set in /etc/nmon.conf
if [ -f /etc/nmon.conf ]; then
	. /etc/nmon.conf
fi

# Capture the splunk_http_url
splunk_http_url=`echo $nmon2csv_options | grep -Po "splunk_http_url\s{0,}\K[^\s]*"`

# Capture the splunk_http_token
splunk_http_token=`echo $nmon2csv_options | grep -Po "splunk_http_token\s{0,}\K[^\s]*"`

# Manage FQDN option
echo $nmon2csv_options | grep '\-\-use_fqdn' >/dev/null
if [ $? -eq 0 ]; then
    HOST=`hostname -f`
else
    HOST=`hostname`
fi

############################################
# functions
############################################

# Store stdin
output=""
while read line ; do
	echo "$line" >> ${userarg1}
	case $output in
	"")
	    output="$line"
	    ;;
	*)
{'fraction_non_alphanumeric': 0.24786885245901638, 'fraction_numerical': 0.013114754098360656, 'mean_word_length': 3.8816, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '7657193', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1087, 'n_words': 286}