Highlighted
Honored Contributor.
Honored Contributor.
532 views

Hexadecimal to decimal in Console??

Jump to solution

Hello Guys,

Hopefully this is a quick one, does anyone know the velocity to convert Hex to decimal so i may use it in a rule?

Thanks

Oliver

0 Likes
1 Solution

Accepted Solutions
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Hello Oliver

Great question as usual

After some digging up looks like Velocity template variables can be used for Java String methods

Such as

replaceAll
length
toLowerCase
toUpperCase
toString
concat
getBytes
hashCode
indexOf

And Else if

 

The java method that uses to convert hex to decimal is related to Integers  and not string so it isn't valid in this case  

this wont be a quick one

You can write a complex Else If velocity variable but it wont be intuitive

Best regards

David

View solution in original post

0 Likes
4 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Hello Oliver

Great question as usual

After some digging up looks like Velocity template variables can be used for Java String methods

Such as

replaceAll
length
toLowerCase
toUpperCase
toString
concat
getBytes
hashCode
indexOf

And Else if

 

The java method that uses to convert hex to decimal is related to Integers  and not string so it isn't valid in this case  

this wont be a quick one

You can write a complex Else If velocity variable but it wont be intuitive

Best regards

David

View solution in original post

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

As always David your responses are greatly appreciated.

I see.

I had hoped this would be a quick win but i may try the conversion at the event source and see if that is an easier work around.

Many Thanks

Oliver

0 Likes
Highlighted
New Member.
So did anyone come up with a solution for this? I'm facing the same dilemma because Windows in its wonderfulness writes Process IDs as Hex, but other things log as Integer.
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Only solution I can think of currently is to send the logs from windows to a file, run a script on the file to replace the hex to decimal (python , powershell or anything else)

then use these files as a log source for a folder reader connector

Seems like a lot of overhead by that's until ArcSight will provide an out of the box variable to do that

Best regards

David

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.