Security

Setup screen screen example using a custom endpoint

lhy719
New Member

I encounter a similar problem as thread 12702. I followed instruction on 'Setup screen example using a custom endpoint' to create a custom settings of my apps. However I get an error message "Your entry was not saved. The following error was reported: undefined. ", when I save configuration changes on Web UI.

setup.xml is same as the example Splunk provided.

Content of my restmap.conf,

[admin_external:appsettings]

handlertype = python

handlerfile = App_python_handler.py

handleractions = list, edit

Content of my App_python_handler.py,

import splunk.admin as admin

import splunk.entity as en

class ConfigApp(admin.MConfigHandler):

def setup(self): if self.requestedAction == admin.ACTION_EDIT: for arg in ['field_1', 'field_2_boolean', 'field_3']: self.supportedArgs.addOptArg(arg)

def handleList(self, confInfo): confDict = self.readConf("appsettings") if None != confDict: for stanza, settings in confDict.items(): for key, val in settings.items(): if key in ['field_2_boolean']: if int(val) == 1: val = '0' else: val = '1' if key in ['field_1'] and val in [None, '']: val = '' confInfo[stanza].append(key, val)

def handleEdit(self, confInfo):

name = self.callerArgs.id
args = self.callerArgs

self.writeConf('appsettings', 'setupentity', self.callerArgs.data)

admin.init(ConfigApp, admin.CONTEXT_NONE)

My envirnment is fedora 14 with splunk 4.2 upgraded from 4.17

0 Karma

LukeMurphey
Champion

The error messages in the user interface are oftentimes ambiguous. The best way to find the core problem is to do a search for the errors in the internal index. This will reveal the complete stack trace (including the exact line that caused the error).

Below is an example:

index=_internal error

(BTW: I'm posting this despite the fact the person who asked the question found the answer in case others are trying to debug similar issues)

0 Karma

lhy719
New Member

It's not a problem anymore. I Moved the apps to another splunk 4.2, and it runs well.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...