Skip to content

Commit

Permalink
some cleanup of the git diff
Browse files Browse the repository at this point in the history
  • Loading branch information
hughesjj committed Jan 15, 2025
1 parent 7c755e3 commit eee157a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ -z "$SPLUNK_HOME" ]; then
fi

SPLUNK_OTEL_FLAGS=""
SPLUNK_OTEL_TA_DEBUG="DEBUG"
#SPLUNK_OTEL_TA_DEBUG="DEBUG"

# Begin autogenerated code
configd_name="configd"
Expand Down Expand Up @@ -151,49 +151,49 @@ splunk_TA_otel_read_configs() {
if [ "$has_splunk_api_url" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_api_url_name from line $has_splunk_api_url"
splunk_api_url_value="$(echo "$has_splunk_api_url" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_api_url_name to $splunk_api_url_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_api_url_name to $splunk_api_url_value"
fi

has_splunk_bundle_dir="$(echo "$line" | grep "$splunk_bundle_dir_name")"
if [ "$has_splunk_bundle_dir" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_bundle_dir_name from line $has_splunk_bundle_dir"
splunk_bundle_dir_value="$(echo "$has_splunk_bundle_dir" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_bundle_dir_name to $splunk_bundle_dir_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_bundle_dir_name to $splunk_bundle_dir_value"
fi

has_splunk_config="$(echo "$line" | grep "$splunk_config_name")"
if [ "$has_splunk_config" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_config_name from line $has_splunk_config"
splunk_config_value="$(echo "$has_splunk_config" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_config_name to $splunk_config_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_config_name to $splunk_config_value"
fi

has_splunk_config_dir="$(echo "$line" | grep "$splunk_config_dir_name")"
if [ "$has_splunk_config_dir" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_config_dir_name from line $has_splunk_config_dir"
splunk_config_dir_value="$(echo "$has_splunk_config_dir" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_config_dir_name to $splunk_config_dir_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_config_dir_name to $splunk_config_dir_value"
fi

has_splunk_collectd_dir="$(echo "$line" | grep "$splunk_collectd_dir_name")"
if [ "$has_splunk_collectd_dir" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_collectd_dir_name from line $has_splunk_collectd_dir"
splunk_collectd_dir_value="$(echo "$has_splunk_collectd_dir" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_collectd_dir_name to $splunk_collectd_dir_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_collectd_dir_name to $splunk_collectd_dir_value"
fi

has_splunk_debug_config_server="$(echo "$line" | grep "$splunk_debug_config_server_name")"
if [ "$has_splunk_debug_config_server" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_debug_config_server_name from line $has_splunk_debug_config_server"
splunk_debug_config_server_value="$(echo "$has_splunk_debug_config_server" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_debug_config_server_name to $splunk_debug_config_server_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_debug_config_server_name to $splunk_debug_config_server_value"
fi

has_splunk_config_yaml="$(echo "$line" | grep "$splunk_config_yaml_name")"
if [ "$has_splunk_config_yaml" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_config_yaml_name from line $has_splunk_config_yaml"
splunk_config_yaml_value="$(echo "$has_splunk_config_yaml" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_config_yaml_name to $splunk_config_yaml_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_config_yaml_name to $splunk_config_yaml_value"
fi

has_splunk_gateway_url="$(echo "$line" | grep "$splunk_gateway_url_name")"
Expand All @@ -207,21 +207,21 @@ splunk_TA_otel_read_configs() {
if [ "$has_splunk_hec_url" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_hec_url_name from line $has_splunk_hec_url"
splunk_hec_url_value="$(echo "$has_splunk_hec_url" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_hec_url_name to $splunk_hec_url_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_hec_url_name to $splunk_hec_url_value"
fi

has_splunk_listen_interface="$(echo "$line" | grep "$splunk_listen_interface_name")"
if [ "$has_splunk_listen_interface" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_listen_interface_name from line $has_splunk_listen_interface"
splunk_listen_interface_value="$(echo "$has_splunk_listen_interface" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_listen_interface_name to $splunk_listen_interface_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_listen_interface_name to $splunk_listen_interface_value"
fi

has_splunk_memory_limit_mib="$(echo "$line" | grep "$splunk_memory_limit_mib_name")"
if [ "$has_splunk_memory_limit_mib" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_memory_limit_mib_name from line $has_splunk_memory_limit_mib"
splunk_memory_limit_mib_value="$(echo "$has_splunk_memory_limit_mib" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_memory_limit_mib_name to $splunk_memory_limit_mib_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_memory_limit_mib_name to $splunk_memory_limit_mib_value"
fi

has_splunk_memory_total_mib="$(echo "$line" | grep "$splunk_memory_total_mib_name")"
Expand All @@ -235,21 +235,21 @@ splunk_TA_otel_read_configs() {
if [ "$has_splunk_otel_log_file_name" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_otel_log_file_name from line $has_splunk_otel_log_file_name"
splunk_otel_log_file_value="$(echo "$has_splunk_otel_log_file_name" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_otel_log_file_name to $splunk_otel_log_file_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_otel_log_file_name to $splunk_otel_log_file_value"
fi

has_splunk_ingest_url="$(echo "$line" | grep "$splunk_ingest_url_name")"
if [ "$has_splunk_ingest_url" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_ingest_url_name from line $has_splunk_ingest_url"
splunk_ingest_url_value="$(echo "$has_splunk_ingest_url" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_ingest_url_name to $splunk_ingest_url_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_ingest_url_name to $splunk_ingest_url_value"
fi

has_splunk_realm="$(echo "$line" | grep "$splunk_realm_name")"
if [ "$has_splunk_realm" ] ; then
splunk_TA_otel_log_msg "DEBUG" "reading $splunk_realm_name from line $has_splunk_realm"
splunk_realm_value="$(echo "$has_splunk_realm" | grep -Eo ">(.*?)<" | sed 's/^>\(.*\)<$/\1/')"
splunk_TA_otel_log_msg "DEBUG" "Set $splunk_realm_name to $splunk_realm_value"
splunk_TA_otel_log_msg "INFO" "Set $splunk_realm_name to $splunk_realm_value"
fi
# End autogenerated code

Expand Down Expand Up @@ -328,12 +328,12 @@ splunk_TA_otel_run_agent() {
if [ "$splunk_api_url_value" ] ; then
export SPLUNK_API_URL="$splunk_api_url_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_api_url_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_api_url_name"
fi
if [ "$splunk_bundle_dir_value" ] ; then
export SPLUNK_BUNDLE_DIR="$splunk_bundle_dir_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_bundle_dir_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_bundle_dir_name"
fi
if [ "$splunk_config_value" ] ; then
export SPLUNK_CONFIG="$splunk_config_value"
Expand All @@ -350,7 +350,7 @@ splunk_TA_otel_run_agent() {
if [ "$splunk_collectd_dir_value" ] ; then
export SPLUNK_COLLECTD_DIR="$splunk_collectd_dir_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_collectd_dir_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_collectd_dir_name"
fi
if [ "$splunk_debug_config_server_value" ] ; then
export SPLUNK_DEBUG_CONFIG_SERVER="$splunk_debug_config_server_value"
Expand All @@ -365,17 +365,17 @@ splunk_TA_otel_run_agent() {
if [ "$splunk_gateway_url_value" ] ; then
export SPLUNK_GATEWAY_URL="$splunk_gateway_url_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_gateway_url_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_gateway_url_name"
fi
if [ "$splunk_hec_url_value" ] ; then
export SPLUNK_HEC_URL="$splunk_hec_url_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_hec_url_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_hec_url_name"
fi
if [ "$splunk_listen_interface_value" ] ; then
export SPLUNK_LISTEN_INTERFACE="$splunk_listen_interface_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_listen_interface_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_listen_interface_name"
fi
if [ "$splunk_memory_limit_mib_value" ] ; then
export SPLUNK_MEMORY_LIMIT_MIB="$splunk_memory_limit_mib_value"
Expand All @@ -388,14 +388,14 @@ splunk_TA_otel_run_agent() {
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_memory_total_mib_name"
fi
if [ "$splunk_otel_log_file_value" ] ; then
export SPLUNK_OTEL_LOG_FILE="$splunk_otel_log_file_value"
export SPLUNK_OTEL_LOG_FILE_NAME="$splunk_otel_log_file_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_otel_log_file_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_otel_log_file_name"
fi
if [ "$splunk_ingest_url_value" ] ; then
export SPLUNK_INGEST_URL="$splunk_ingest_url_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_ingest_url_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_ingest_url_name"
fi
if [ "$splunk_realm_value" ] ; then
export SPLUNK_REALM="$splunk_realm_value"
Expand All @@ -405,22 +405,22 @@ splunk_TA_otel_run_agent() {
if [ "$configd_value" ] ; then
SPLUNK_OTEL_FLAGS="$SPLUNK_OTEL_FLAGS --configd"
else
splunk_TA_otel_log_msg "DEBUG" "BOOLEAN PARAM NOT SET: $configd_name"
splunk_TA_otel_log_msg "INFO" "BOOLEAN PARAM NOT SET: $configd_name"
fi
if [ "$discovery_value" ] ; then
SPLUNK_OTEL_FLAGS="$SPLUNK_OTEL_FLAGS --discovery"
else
splunk_TA_otel_log_msg "DEBUG" "BOOLEAN PARAM NOT SET: $discovery_name"
splunk_TA_otel_log_msg "INFO" "BOOLEAN PARAM NOT SET: $discovery_name"
fi
if [ "$discovery_properties_value" ] ; then
SPLUNK_OTEL_FLAGS="$SPLUNK_OTEL_FLAGS --discovery-properties=$discovery_properties_value"
else
splunk_TA_otel_log_msg "DEBUG" "STRING PARAM NOT SET: $discovery_properties_name"
splunk_TA_otel_log_msg "INFO" "STRING PARAM NOT SET: $discovery_properties_name"
fi
if [ "$splunk_access_token_file_value" ] ; then
export SPLUNK_ACCESS_TOKEN_FILE="$splunk_access_token_file_value"
else
splunk_TA_otel_log_msg "DEBUG" "NOT SET: $splunk_access_token_file_name"
splunk_TA_otel_log_msg "INFO" "NOT SET: $splunk_access_token_file_name"
fi
# End autogenerated code

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ if "%splunk_bundle_dir_value%" == "" (
if "%splunk_config_value%" == "" (
call :splunk_TA_otel_log_msg "DEBUG" "Param %splunk_config_name% not set"
) else (
set "SPLUNK_OTEL_FLAGS=%SPLUNK_OTEL_FLAGS% --config=%splunk_config_value%"
set "SPLUNK_CONFIG=%splunk_config_value%"
)
if "%splunk_config_dir_value%" == "" (
Expand Down Expand Up @@ -194,7 +195,7 @@ if "%discovery_value%" == "true" (
call :splunk_TA_otel_log_msg "DEBUG" "Optional flag %discovery_name% not set"
)
if "%discovery_properties_value%" != "" (
set "SPLUNK_OTEL_FLAGS=%SPLUNK_OTEL_FLAGS% --discovery-properties-file=%discovery_properties_value%"
set "SPLUNK_OTEL_FLAGS=%SPLUNK_OTEL_FLAGS% --discovery-properties=%discovery_properties_value%"
) else (
call :splunk_TA_otel_log_msg "DEBUG" "Optional flag %discovery_properties_name% not set"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ tar -C "$ADDON_DIR" -hcz --file "$TA_FULLPATH" "Splunk_TA_otel"

echo "Testing with hot TA $TA_FULLPATH ($ADDON_DIR and $REPACKED_TA_NAME)"

# Set perms on addon dir
#chmod a+rwx "$ADDON_DIR"
#chmod a+rwx "$ADDON_DIR/$REPACKED_TA_NAME"

DOCKER_COMPOSE_CONFIG="$SOURCE_DIR/packaging-scripts/cicd-tests/discovery/docker-compose.yml"
REPACKED_TA_NAME=$REPACKED_TA_NAME ADDON_DIR=$ADDON_DIR docker compose --file "$DOCKER_COMPOSE_CONFIG" up --build --force-recreate --wait --detach --timestamps

Expand Down

0 comments on commit eee157a

Please sign in to comment.