Refine your search:

4
1

The windows app ships with some files that end in .path in the bin directory. How do these work? Is there any particular design goal of these? Can I use this mechanism as a customer?

asked 16 Apr '10, 18:16

jrodman's gravatar image

jrodman ♦
5.8k2515
accept rate: 42%


One Answer:

.path files are an optimization which allows Splunk to run scripted inputs which call other programs outside the BIN directory (e.g. Windows Powershell). The .path file contains the command line you want to execute, including both the program you want to run and its command-line parameters. Think of it like a one-line batch file.

More details:

As a security precaution, Splunk will only execute scripted inputs inside an app's BIN directory. This ensures that, in order to run custom code on a Splunk server, an administrator actually has to copy [or create -ed] a file into an app's BIN directory. However, this makes it hard to execute non-Python scripted inputs (e.g. powershell scripts on windows) since those inputs require running an executable which lives outside the BIN directory.

Of course, you could create a one-line BAT or CMD file (or its *nix equivalent) which would simply launch the desired executable. But that's inefficient-- Splunk would be spinning up a new shell process whose whole purpose in life was immediately starting another program. Furthermore, making things worse, when Splunk shuts down it makes it hard to ensure that the "grandchild" process is shut down too.

For this reason, Splunk offers the .path file option, which functions just like a one-line batch file, but doesn't spin up a new process each time which is better for performance and enables cleaner shutdowns.

link

answered 16 Apr '10, 20:27

Justin%20Grant's gravatar image

Justin Grant
1.5k6739
accept rate: 50%

edited 19 Apr '10, 22:15

Does this work for platforms other than Windows? (For example, on Linux)

(09 Aug '11, 12:30) Lowell ♦

think of it as a symbolic link.

(09 Aug '11, 12:57) gkanapathy ♦

I got it to work in Linux. (I had forgotten to use the absolute path to my executable. Whoops!) However, this STILL caused a shell (/bin/sh -c) process to be launched. See http://splunk-base.splunk.com/answers/28733/scripted-input-without-a-shell

(09 Aug '11, 13:30) Lowell ♦
Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×302
×89

Asked: 16 Apr '10, 18:16

Seen: 657 times

Last updated: 09 Aug '11, 14:07

Copyright © 2005-2012 Splunk, Inc. All rights reserved.