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!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...