cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

Using a non named field for API query

I am able to do queries with PowerShell to the SIEM REST API and get the results if I use named fields that I retrieved from qryGetFilterFields.  I also found that there are many custom fields in the list that only have an ID, how do I search using those fields?

1 Reply
Highlighted

Re: Using a non named field for API query

Hello

The ESM will send you query results with internals column names like "Alert.105250817", they are actually named under the hood but you need to know and manually make the naming correspondence. 

Maybe the Python API wrapper (https://github.com/mfesiem/msiempy) can help you mapping automatically internal fields names to nicknames usable in queries.

It's weird because you need to make your query with the fields name but the ESM is replying with internal names... The Python wrapper will handle all of that for you.

Here is the mapping on which the correspondance can be done :

 SIEM_FIELDS_MAP_INTERNAL_NAME_TO_NICKNAME = {
    'Alert.105250817': 'DNS - Response_Code_Name',
    'Alert.122028033': 'DNS - Query',
    'Alert.196609': 'Queue_ID',
    'Alert.21364737': 'DNS - Class',
    'Alert.21364738': 'Registry - Key',
    'Alert.21364739': 'Old_Reputation - GTI_File',
    'Alert.21364740': 'New_Reputation - GTI_File',
    'Alert.262145': 'Response_Time',
    'Alert.262146': 'NAT_Details',
    'Alert.262152': 'PID',
    'Alert.262153': 'Grid_Master_IP',
    'Alert.262154': 'Device_IP',
    'Alert.262155': 'Device_Port',
    'Alert.262156': 'External_EventID',
    'Alert.262157': 'Spam_Score',
    'Alert.262158': 'External_SubEventID',
    'Alert.262159': 'File_Hash',
    'Alert.262160': 'Handle_ID',
    'Alert.262161': 'Instance_GUID',
    'Alert.262162': 'Agent_GUID',
    'Alert.262163': 'UUID',
    'Alert.262164': 'Reputation',
    'Alert.262165': 'DAT_Version',
    'Alert.262166': 'Server_ID',
    'Alert.262167': 'Policy_ID',
    'Alert.262168': 'Handheld_ID',
    'Alert.262169': 'Database_GUID',
    'Alert.262170': 'Analyzer_DAT_Version',
    'Alert.262171': 'Reputation_Score',
    'Alert.262172': 'Parent_File_Hash',
    'Alert.262173': 'Incident_ID',
    'Alert.262174': 'Victim_IP',
    'Alert.262175': 'Attacker_IP',
    'Alert.262176': 'Object_GUID',
    'Alert.262177': 'Reputation_Server_IP',
    'Alert.262178': 'DNS_Server_IP',
    'Alert.262179': 'Device_Confidence',
    'Alert.38141953': 'DNS - Class_Name',
    'Alert.38141954': 'Registry - Value',
    'Alert.38141955': 'Old_Reputation - TIE_File',
    'Alert.38141956': 'New_Reputation - TIE_File',
    'Alert.4259841': 'URL',
    'Alert.4259842': 'Message_Text',
    'Alert.4259843': 'Filename',
    'Alert.4259844': 'From',
    'Alert.4259845': 'To',
    'Alert.4259846': 'Cc',
    'Alert.4259847': 'Bcc',
    'Alert.4259848': 'Subject',
    'Alert.4259849': 'User_Agent',
    'Alert.4259850': 'Cookie',
    'Alert.4259851': 'Referer',
    'Alert.4259852': 'Destination_Filename',
    'Alert.4259853': 'Client_Version',
    'Alert.4259854': 'Job_Name',
    'Alert.4259855': 'Language',
    'Alert.4259856': 'SWF_URL',
    'Alert.4259857': 'TC_URL',
    'Alert.4259858': 'RTMP_Application',
    'Alert.4259859': 'Version',
    'Alert.4259860': 'Local_User_Name',
    'Alert.4259867': 'DNS_Name',
    'Alert.4259868': 'SNMP_Item',
    'Alert.4259869': 'Sensor_UUID',
    'Alert.4259870': 'Process_Name',
    'Alert.4259871': 'Source_Context',
    'Alert.4259872': 'Target_Context',
    'Alert.4259873': 'Description',
    'Alert.4259874': 'SQL_Statement',
    'Alert.4259875': 'From_Address',
    'Alert.4259876': 'To_Address',
    'Alert.4259877': 'File_Path',
    'Alert.4259878': 'Target_Process_Name',
    'Alert.4259879': 'Privileges',
    'Alert.4259880': 'Search_Query',
    'Alert.4259881': 'PCAP_Name',
    'Alert.4259882': 'Vulnerability_References',
    'Alert.4259883': 'Access_Privileges',
    'Alert.4259884': 'Old_Value',
    'Alert.4259885': 'New_Value',
    'Alert.4259886': 'Device_URL',
    'Alert.4259887': 'Engine_List',
    'Alert.4456449': 'Num_Copies',
    'Alert.4456450': 'Start_Page',
    'Alert.4456451': 'End_Page',
    'Alert.4456457': 'NTP_Offset_To_Monitor',
    'Alert.4456458': 'Confidence',
    'Alert.4456459': 'Hops',
    'Alert.4456460': 'Priority',
    'Alert.54919169': 'DNS - Type',
    'Alert.54919171': 'Old_Reputation - ATD_File',
    'Alert.54919172': 'New_Reputation - ATD_File',
    'Alert.65537': 'Signature_Name',
    'Alert.65538': 'Threat_Name',
    'Alert.65539': 'Destination_Hostname',
    'Alert.65540': 'Category',
    'Alert.65541': 'Source_Zone',
    'Alert.65542': 'Destination_Zone',
    'Alert.65543': 'Target_Class',
    'Alert.65544': 'Policy_Name',
    'Alert.65545': 'Event_Class',
    'Alert.65546': 'Request_Type',
    'Alert.65547': 'Message_ID',
    'Alert.65548': 'Mail_ID',
    'Alert.65549': 'Recipient_ID',
    'Alert.65550': 'Delivery_ID',
    'Alert.65551': 'Creator_Name',
    'Alert.65552': 'External_Application',
    'Alert.65553': 'External_DB2_Server',
    'Alert.65554': 'Table_Name',
    'Alert.65555': 'Access_Resource',
    'Alert.65556': 'Catalog_Name',
    'Alert.65557': 'DB2_Plan_Name',
    'Alert.65558': 'File_Type',
    'Alert.65559': 'FTP_Command',
    'Alert.65560': 'Job_Type',
    'Alert.65561': 'Logical_Unit_Name',
    'Alert.65562': 'LPAR_DB2_Subsystem',
    'Alert.65563': 'Step_Count',
    'Alert.65564': 'Step_Name',
    'Alert.65565': 'Volume_ID',
    'Alert.65566': 'Source_UserID',
    'Alert.65567': 'Destination_UserID',
    'Alert.65568': 'Mainframe_Job_Name',
    'Alert.65569': 'Database_ID',
    'Alert.65570': 'Malware_Insp_Action',
    'Alert.65571': 'Malware_Insp_Result',
    'Alert.65572': 'Source_Network',
    'Alert.65573': 'Destination_Network',
    'Alert.65574': 'Incoming_ID',
    'Alert.65575': 'External_Hostname',
    'Alert.65576': 'Area',
    'Alert.65577': 'Facility',
    'Alert.65578': 'Privileged_User',
    'Alert.65579': 'Operating_System',
    'Alert.65580': 'Logon_Type',
    'Alert.65581': 'Management_Server',
    'Alert.65582': 'External_SessionID',
    'Alert.65583': 'Source_Logon_ID',
    'Alert.65584': 'Destination_Logon_ID',
    'Alert.65585': 'Session_Status',
    'Alert.65586': 'URL_Category',
    'Alert.65587': 'Caller_Process',
    'Alert.65588': 'Registry_Key',
    'Alert.65589': 'Registry_Value',
    'Alert.65590': 'Mailbox',
    'Alert.65591': 'Directory',
    'Alert.65592': 'Destination_Directory',
    'Alert.65593': 'SQL_Command',
    'Alert.65594': 'Device_Action',
    'Alert.65595': 'Threat_Category',
    'Alert.65596': 'Threat_Handled',
    'Alert.65597': 'Reason',
    'Alert.65599': 'Detection_Method',
    'Alert.65600': 'Virtual_Machine_Name',
    'Alert.65601': 'Virtual_Machine_ID',
    'Alert.65602': 'Datacenter_ID',
    'Alert.65603': 'Datacenter_Name',
    'Alert.65604': 'Interface_Dest',
    'Alert.65605': 'Organizational_Unit',
    'Alert.65606': 'External_Device_Type',
    'Alert.65607': 'External_Device_ID',
    'Alert.65608': 'External_Device_Name',
    'Alert.65609': 'Service_Name',
    'Alert.65610': 'Reputation_Name',
    'Alert.65611': 'Status',
    'Alert.65612': 'Sub_Status',
    'Alert.65613': 'Web_Domain',
    'Alert.65614': 'Group_Name',
    'Alert.65615': 'App_Layer_Protocol',
    'Alert.65616': 'Rule_Name',
    'Alert.65617': 'Security_ID',
    'Alert.65618': 'Authentication_Type',
    'Alert.65619': 'SHA1',
    'Alert.65620': 'File_ID',
    'Alert.65621': 'Attribute_Type',
    'Alert.65622': 'Access_Mask',
    'Alert.65623': 'VPN_Feature_Name',
    'Alert.65624': 'Hash',
    'Alert.65625': 'Hash_Type',
    'Alert.65627': 'Subcategory',
    'Alert.65628': 'CnC_Host',
    'Alert.65629': 'Share_Name',
    'Alert.65630': 'SHA256',
    'Alert.71696385': 'DNS - Type_Name',
    'Alert.71696387': 'Old_Reputation - GTI_Cert',
    'Alert.71696388': 'New_Reputation - GTI_Cert',
    'Alert.88473601': 'DNS - Response_Code',
    'Alert.88473603': 'Old_Reputation - TIE_Cert',
    'Alert.88473604': 'New_Reputation - TIE_Cert',
    'Alert.ASNGeoDst': 'ASNGeoDst',
    'Alert.ASNGeoSrc': 'ASNGeoSrc',
    'Alert.Action': 'Action',
    'Alert.AlertID': 'AlertID',
    'Alert.AppIDCat': 'AppIDCat',
    'Alert.AvgSeverity': 'AvgSeverity',
    'Alert.BIN(1)': 'AppID',
    'Alert.BIN(10)': 'Object_Type',
    'Alert.BIN(11)': 'Method',
    'Alert.BIN(12)': 'File_Operation',
    'Alert.BIN(13)': 'File_Operation_Succeeded',
    'Alert.BIN(14)': 'User_Nickname',
    'Alert.BIN(15)': 'Contact_Name',
    'Alert.BIN(16)': 'Contact_Nickname',
    'Alert.BIN(17)': 'DNS_Type',
    'Alert.BIN(18)': 'DNS_Class',
    'Alert.BIN(19)': 'Query_Response',
    'Alert.BIN(2)': 'CommandID',
    'Alert.BIN(20)': 'Authoritative_Answer',
    'Alert.BIN(21)': 'SNMP_Operation',
    'Alert.BIN(22)': 'SNMP_Item_Type',
    'Alert.BIN(23)': 'SNMP_Version',
    'Alert.BIN(24)': 'SNMP_Error_Code',
    'Alert.BIN(25)': 'NTP_Client_Mode',
    'Alert.BIN(26)': 'NTP_Server_Mode',
    'Alert.BIN(27)': 'NTP_Request',
    'Alert.BIN(28)': 'NTP_Opcode',
    'Alert.BIN(29)': 'Interface',
    'Alert.BIN(3)': 'DomainID',
    'Alert.BIN(30)': 'Direction',
    'Alert.BIN(31)': 'Sensor_Name',
    'Alert.BIN(32)': 'Sensor_Type',
    'Alert.BIN(33)': 'Response_Code',
    'Alert.BIN(34)': 'Return_Code',
    'Alert.BIN(4)': 'HostID',
    'Alert.BIN(5)': 'ObjectID',
    'Alert.BIN(6)': 'UserIDDst',
    'Alert.BIN(7)': 'UserIDSrc',
    'Alert.BIN(8)': 'Database_Name',
    'Alert.BIN(9)': 'Application_Protocol',
    'Alert.CommandIDCat': 'CommandIDCat',
    'Alert.DSID': 'DSID',
    'Alert.DSIDSigID': 'DSIDSigID',
    'Alert.DomainIDCat': 'DomainIDCat',
    'Alert.DstIP': 'DstIP',
    'Alert.DstMac': 'DstMac',
    'Alert.DstPort': 'DstPort',
    'Alert.EventCount': 'EventCount',
    'Alert.FirstTime': 'FirstTime',
    'Alert.Flow': 'Flow',
    'Alert.FlowID': 'FlowID',
    'Alert.GUIDDst': 'GUIDDst',
    'Alert.GUIDSrc': 'GUIDSrc',
    'Alert.HostIDCat': 'HostIDCat',
    'Alert.IPSID': 'IPSID',
    'Alert.IPSIDAlertID': 'IPSIDAlertID',
    'Alert.LastTime': 'LastTime',
    'Alert.LastTime_usec': 'LastTime_usec',
    'Alert.ObjectIDCat': 'ObjectIDCat',
    'Alert.Protocol': 'Protocol',
    'Alert.RemCaseID': 'RemCaseID',
    'Alert.RemOpenTicketTime': 'RemOpenTicketTime',
    'Alert.Reviewed': 'Reviewed',
    'Alert.Sequence': 'Sequence',
    'Alert.SessionID': 'SessionID',
    'Alert.Severity': 'Severity',
    'Alert.SigID': 'SigID',
    'Alert.SrcIP': 'SrcIP',
    'Alert.SrcMac': 'SrcMac',
    'Alert.SrcPort': 'SrcPort',
    'Alert.Trusted': 'Trusted',
    'Alert.UserFld10Cat': 'UserFld10Cat',
    'Alert.UserFld21Cat': 'UserFld21Cat',
    'Alert.UserFld22Cat': 'UserFld22Cat',
    'Alert.UserFld23Cat': 'UserFld23Cat',
    'Alert.UserFld24Cat': 'UserFld24Cat',
    'Alert.UserFld25Cat': 'UserFld25Cat',
    'Alert.UserFld26Cat': 'UserFld26Cat',
    'Alert.UserFld27Cat': 'UserFld27Cat',
    'Alert.UserFld8Cat': 'UserFld8Cat',
    'Alert.UserFld9Cat': 'UserFld9Cat',
    'Alert.UserIDDstCat': 'UserIDDstCat',
    'Alert.UserIDSrcCat': 'UserIDSrcCat',
    'Alert.VLan': 'VLan',
    'Alert.WriteTime': 'WriteTime',
    'Alert.ZoneDst': 'ZoneDst',
    'Alert.ZoneSrc': 'ZoneSrc'}

 

Hope this helps !

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community