Splunk Search

Phantom.debug() string won't perform string interpolation.

nhammSplunk
Explorer

Why won't this phantom.debug() string perform string interpolation?

foo = "bar"
phantom.debug("Testing: {foo}")

It should read as "Testing: bar"

Tags (3)
0 Karma
1 Solution

cblumer_splunk
Splunk Employee
Splunk Employee

This method works for that:

phantom.debug("Testing: {}".format(foo))

View solution in original post

djacquens
Path Finder

This is an old question but I believe it is because you forgot the f before the string.
It should be:

phantom.debug(f"Testing: {foo}")

 😉

0 Karma

cblumer_splunk
Splunk Employee
Splunk Employee

This method works for that:

phantom.debug("Testing: {}".format(foo))
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...