Installation

Splunk Enterprise installation script error under Yosemite 10.10.3 OS X "syntax error: Expected end of line, etc. but found unknown token"

ebeffel
Engager

[QUESTION at bottom]
After installing Splunk from the dmg, when I use the little helper to get Splunk Enterprise running in my browser, I get the following error message:

error "osascript: OpenScripting.framework - scripting addition \"/Library/ScriptingAdditions/Numerics.osax\" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
osascript: OpenScripting.framework - scripting addition \"/Library/ScriptingAdditions/Satimage.osax\" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
osascript: OpenScripting.framework - scripting addition \"/Library/ScriptingAdditions/XMLLib.osax\" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
307:308: syntax error: Expected end of line, etc. but found unknown token. (-2741)" number 1

The Script Editor in Debug mode shows that the startup script is failing on the last line of this script (note that the comments are as Script Editor reports them, not something that I added; using COMMENT# to correct formatting artifacts):


set SCRIPT_NAME to "osxManageSplunk.sh"
set SPLUNK_ICON to path to resource "splunk_icon.icns"
COMMENT# Single line file, populated by postinstall script, required: no newline.
set SPLUNK_HOME_FILE to path to resource "SPLUNK_HOME.path"

COMMENT# Read SPLUNK_HOME value from above file.
open for access SPLUNK_HOME_FILE
set SPLUNK_HOME to (read SPLUNK_HOME_FILE)
close access SPLUNK_HOME_FILE

COMMENT# Get path as /foo/bar instead of Foo:Bar.  God I hate you,
COMMENT# AppleScript.  I don't understand you, but I do know I hate you.
set SCRIPT_PATH to POSIX path of (path to resource SCRIPT_NAME)

COMMENT# Run startup shell script and pass in SPLUNK_HOME path. And as
COMMENT# always, quote it.  /bin/sh Macintosh HD doesn't work so well.
do shell script "\"" & SCRIPT_PATH & "\" \"" & SPLUNK_HOME & "\" \"" & SPLUNK_ICON & "\""

QUESTION: Any idea what I'm doing wrong? How do I make this work?

Labels (1)
0 Karma

chazha83
New Member

Here's an automated way to do it from an icon in your GUI, assuming you put Splunk in its default location in the Applications folder, change the script if you did not put it in Applications .

Open up Script Editor, paste this in, save it to something that makes sense to you, may want to save as "File Format" "Application" so that all you need to do is double click your icon to get it up and running. To shut down Splunk, the 'do shell script' line below can be used, and just substitute the word "stop" for "start"

Happy Splunking!

# Start Splunk Script using AppleScript
# Editor: Chuck Hauge - 5/21/17

do shell script "'Applications/Splunk/bin/splunk' start"

tell application "Safari"
    tell window 1
        set current tab to (make new tab with properties {URL:"http://localhost:8000"})
    end tell
end tell
0 Karma

ebeffel
Engager

Work around: Starting Splunk from the command line and then opening the browser to http://.local:8000 started the app without the error message. Ernie

barsmart
New Member

Thanks - this worked.

For those of you who don't work in command line every day, to start Splunk from command line

Open up your Terminal application and type

./Applications/Splunk/bin/splunk start

(You must include the period)

Wait for it to finish setting up and it will give you a URL for your browser.

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...