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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...