Data type of a Keyword attribute in an XML event log

238 Views Asked by At

I'm just wondering how will i be able to save a keyword attribute coming from an xml eventlog (.evtx). As an example, a keyword value is 0x800000000000000, what kind of datatype is this in sql if i'm going to save it in a table.

1

There are 1 best solutions below

0
On

You could take the long value and use .ToString() with the "X" formatter to get the hexadecimal value, but you'll need to add the "0x" manually.

Here's a trivial example:

long keyword = 0x800000000000000;
string hexValue = String.Format("0x{0}", keyword.ToString());

The long value for keyword is 576460752303423488, and the value in hexValue is 0x800000000000000.

Adjust and adapt to fit your code :)