Documentation: 3.4.1
Print Version Contents
This page last updated: 11/19/08 03:11pm

restmap.conf

Set new endpoints via restmap.conf.

restmap.conf.spec

# Copyright (C) 2005-2008 Splunk Inc.  All Rights Reserved.  Version 3.2
#
# This file contains possible attribute and value pairs for creating new rest endpoints.
#
# There is a restmap.conf in $SPLUNK_HOME/etc/system/default/.  To set custom configurations, 
# place a restmap.conf in $SPLUNK_HOME/etc/system/local/. For help, see
# restmap.conf.example. You must restart Splunk to enable configurations.
#
# To learn more about configuration files (including precedence) please see the documentation 
# located at http://www.splunk.com/doc/latest/admin/BundlesIntro.

# NOTE: You must register every REST endpoint via this file to make it available.

###########################
# Global stanza

[global]
* This stanza sets global configurations for all REST endpoints. 
* Follow this stanza name with any number of the following attribute/value pairs.

allowGetAuth=<true | false>
* Allow user/password to be passed as a GET paramater to endpoint services/auth/login.  
* Setting this to true, while convenient, may result in user/password getting 
logged as cleartext in Splunk's logs *and* any proxy servers in between. 
* Defaults to false.  

pythonHandlerPath=<path>
* Path to 'main' python script handler.
* Used by the script handler to determine where the actual 'main' script is located.  
* Typically, you should not need to change this.
* Defaults to $SPLUNK_HOME/bin/rest_handler.py.

###########################
# Per-endpoint stanza 
# Specify a handler and other handler-specific settings.  
# The handler is responsible for implementing arbitrary namespace underneath each REST endpoint.

[script:<uniqueName>]
* NOTE: The uniqueName must be different for each handler.
* Call the specified hanlder when executing this endpoint.
* The following attribute/value pairs support the script handler.

scripttype=python
* Tell the system what type of script to execute when using this endpoint.
* Defaults to python.
* Python is currently the only option for scripttype.
    
handler=<SCRIPT>.<CLASSNAME>
* The name and class name of the file to execute.  
* The file *must* live in an application's ../rest/ subdirectory.
 * For example, $SPLUNK_HOME/etc/apps/<APPNAME>/default/rest/TestHandler.py 
has a class called MyHandler (which, in the case of python must be derived from a base class called 
'splunk.rest.BaseRestHandler'). The tag/value pair for this is: "handler=TestHandler.MyHandler".

match=<path>
* Specify the URI that calls the handler. 
* For example if match=/foo, then https://$SERVER:$PORT/services/foo calls this handler.  
* NOTE: You must start your path with a /.

requireAuthentication=<true | false>
* This OPTIONAL tag determines if this endpoint requires authentication or not.  
* It defaults to 'true'.

capability=<capabilityName>
capability.<post|delete|get|put>=<capabilityName>
* Depending on the HTTP method, check capabilities on the authenticated session user.
* If you use 'capability.post|delete|get|put,' then the associated method is checked 
against the authenticated user's role. 
* If you just use 'capability,' then all calls get checked against this capability (regardless 
of the HTTP method).

xsl=<path to XSL transform file>
* Optional.
* Perform an optional XSL transform on data returned from the handler.
* Only use this if the data is XML.

script=<path to a script executable>
* Optional.
* Execute a script which is *not* derived from 'splunk.rest.BaseRestHandler'.
* Put the path to that script here.  
* This is rarely used.
* Do not use this unless you know what you are doing.

restmap.conf.example

# Copyright (C) 2005-2008 Splunk Inc.  All Rights Reserved.  Version 3.0 
#
# This file contains example REST endpoint configurations.
#
# To use one or more of these configurations, copy the configuration block into
# restmap.conf in $SPLUNK_HOME/etc/system/local/. You must restart Splunk to enable configurations.
#
# To learn more about configuration files (including precedence) please see the documentation 
# located at http://www.splunk.com/doc/latest/admin/BundlesIntro.

# The following are sample rest endpoint configurations.  To create your own endpoints, modify 
# the values by following the spec outlined in restmap.conf.spec.

############################
#  Srcipt-specific Settings
############################

# This examples sets up endpoints for the globe script (see Splunk Developer documentation for more details).

[script:globe]
match = /globe/main
handler = handlers.globe
requireAuthentication = false

[script:iploc]
match = /globe/iploc
handler = handlers.iploc
requireAuthentication = false

[script:jquery]
match = /globe/jquery.js
handler = handlers.jquery
requireAuthentication = false

[script:lastips]
match = /globe/lastips
handler = handlers.lastips
requireAuthentication = false
Previous: regmon-filters.conf    |    Next: savedsearches.conf

Comments

No comments have been submitted.

Log in to comment.