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!

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...

Splunk Answers Content Calendar, June Edition II

Get ready to dive into Splunk Dashboard panels this week! We'll be tackling common questions around ...

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...