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!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...