Splunk Dev

Can the .spec be retrieved via REST

abramble
Explorer

Similar to fetching config by namespace via REST - Configuration Endpoints, is there a way to access the .spec defined for different config files via REST API?

Edit: spelling.

Labels (1)
0 Karma
1 Solution

abramble
Explorer

Answering my own question. After digging around I discovered in the default restmap.conf a reference to

[spec:spec]
match=/configs/spec

What appears to be merged spec from all apps is available, however I cannot find any documentation of the input params. "filename" and "stanza" I was able to guess.

/services/config/spec?filename=alert_actions

{
  "filename": "alert_actions",
  "stanzas": [
    {
      "stanza": "default",
      "rawStanza": "default"
    },
    {
      "stanza": "email",
      "rawStanza": "email"
    },
    {
      "stanza": "logevent",
      "rawStanza": "logevent"
    },
    {
      "stanza": "lookup",
      "rawStanza": "lookup"
    },
    {
      "stanza": "outputtelemetry",
      "rawStanza": "outputtelemetry"
    },
    {
      "stanza": "populate_lookup",
      "rawStanza": "populate_lookup"
    },
    {
      "stanza": "rss",
      "rawStanza": "rss"
    },
    {
      "stanza": "script",
      "rawStanza": "script"
    },
    {
      "stanza": "summary_index",
      "rawStanza": "summary_index"
    },
    {
      "stanza": "webhook",
      "rawStanza": "webhook"
    }
  ]
}


and deeper inspection by passing the 'stanza' parameter

/services/configs/spec?filename=alert_actions&stanza=email

{
  "filename": "alert_actions",
  "stanza": "email",
  "settings": [
    {
      "name": "alert.execute.cmd",
      "placeholder": "<string>"
    },
    {
      "name": "alert.execute.cmd.arg.<n>",
      "placeholder": "<string>"
    },
    {
      "name": "auth_password",
      "placeholder": "<password>"
    }
  ]
  ... elided
}

 

View solution in original post

Tags (1)
0 Karma

abramble
Explorer

Answering my own question. After digging around I discovered in the default restmap.conf a reference to

[spec:spec]
match=/configs/spec

What appears to be merged spec from all apps is available, however I cannot find any documentation of the input params. "filename" and "stanza" I was able to guess.

/services/config/spec?filename=alert_actions

{
  "filename": "alert_actions",
  "stanzas": [
    {
      "stanza": "default",
      "rawStanza": "default"
    },
    {
      "stanza": "email",
      "rawStanza": "email"
    },
    {
      "stanza": "logevent",
      "rawStanza": "logevent"
    },
    {
      "stanza": "lookup",
      "rawStanza": "lookup"
    },
    {
      "stanza": "outputtelemetry",
      "rawStanza": "outputtelemetry"
    },
    {
      "stanza": "populate_lookup",
      "rawStanza": "populate_lookup"
    },
    {
      "stanza": "rss",
      "rawStanza": "rss"
    },
    {
      "stanza": "script",
      "rawStanza": "script"
    },
    {
      "stanza": "summary_index",
      "rawStanza": "summary_index"
    },
    {
      "stanza": "webhook",
      "rawStanza": "webhook"
    }
  ]
}


and deeper inspection by passing the 'stanza' parameter

/services/configs/spec?filename=alert_actions&stanza=email

{
  "filename": "alert_actions",
  "stanza": "email",
  "settings": [
    {
      "name": "alert.execute.cmd",
      "placeholder": "<string>"
    },
    {
      "name": "alert.execute.cmd.arg.<n>",
      "placeholder": "<string>"
    },
    {
      "name": "auth_password",
      "placeholder": "<password>"
    }
  ]
  ... elided
}

 

Tags (1)
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 ...