Splunk AppDynamics

Getter Chain, Cast from Bool to Int?

Henrik_Juul
New Member

I have created an Information Point which basically works so now I also want to create a metric based on the return value.- Only thing is that the return value is a Boolean so how do I cast it to an Integer (with a Getter Chain I suppose)?

Labels (3)
0 Karma
1 Solution

Morelz
Motivator

Hi Hendrik, you can use normal toInt() or toString() for text values

Example

getBody().toInt()

or

getBody().toInteger()

Can't remember 100% if it's toInt()or toInteger()

View solution in original post

Morelz
Motivator

Hi Hendrik, you can use normal toInt() or toString() for text values

Example

getBody().toInt()

or

getBody().toInteger()

Can't remember 100% if it's toInt()or toInteger()

Henrik_Juul
New Member

Thank you.

I got this to work based on a .Net application:
ReturnValue.Success().Convert.ToInt32()

0 Karma
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...