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!

Unlock New Opportunities with Splunk Education: Explore Our Latest Courses!

At Splunk Education, we’re dedicated to providing top-tier learning experiences that cater to every skill ...

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...