Splunk Search
Highlighted

How to extract multikv field at search-time with dynamic field names from Cisco ISE events?

Builder

I have events from a Cisco ISE device that have multiple (up to 12) "posture reports" per message:

… PostureReport=21 Disk Encryption -- Decrypted\;Passed\;( Disk Encryption Status-Decrypted:Audit:Passed:Passed_Conditions[]:Failed_Conditions[Disk_Encryption_Decrypted_x64:Disk_Encryption_Decrypted_x86:Disk_Encryption_Decrypted]:Skipped_Conditions[]), PostureReport=71 BigFix Service Policy\;Passed\;(BigFix Service Status:Audit:Passed:Passed_Conditions[BigFix_Service_Check]:Failed_Conditions[]:Skipped_Conditions[]), PostureReport=40 Lumension Policy\;Passed\;(Lumension Status:Mandatory:Passed:Passed_Conditions[Lumension_Service_Check]:Failed_Conditions[]:Skipped_Conditions[Lumension_OIG2_Bypass_Check:Lumension_OIG_Bypass_Check]), PostureReport=50 McAfee ePO Install Policy\;Passed\;(McAfee ePO Install Status:Audit:Passed:Passed_Conditions[McAfee_EPO_Registration_Check]:Failed_Conditions[]:Skipped_Conditions[McAfee_EPO_Registration_Check_x86:McAfee_EPOUC_Registration_Check_x86:McAfee_EPOUC_Registration_Check]), PostureReport=81 SCCM Service Policy\;Passed\;(SCCM Service Status:Audit:Passed:Passed_Conditions[SCCM_Service_Check]:Failed_Conditions[]:Skipped_Conditions[]),  ...

The format of the data I am trying to extract is as follows:

PostureReport=21 Disk Encryption -- Decrypted\;Passed\;( Disk Encryption Status-Decrypted:Audit:Passed:Passed_Conditions[]:Failed_Conditions[Disk_Encryption_Decrypted_x64:Disk_Encryption_Decrypted_x86:Disk_Encryption_Decrypted]:Skipped_Conditions[]),

I need to extract the data in the parenthesis for each PostureReport line in the message. The Name of the field need to be dynamically created using the check name which is pulled from the first spot in parenthesis ending at the colon(:). For the message above I would like:

Multikv Field name=DiskEncryptionStatus-Decrypted

Multikv values:
DiskEncryptionStatus-Decrypted[0] = Audit
DiskEncryptionStatus-Decrypted[1]=Passed
DiskEncryptionStatus-Decrypted[2]=[]
DiskEncryptionStatus-Decrypted[3]=DiskEncryptionDecryptedx64:DiskEncryptionDecryptedx86:DiskEncryptionDecrypted]
DiskEncryptionStatus-Decrypted[4]=[]

Or dynamically create field names using the checkname:

DiskEncryptionStatus-Decryptedtype = Audit
Disk
EncryptionStatus-Decryptedstatus=Passed
DiskEncryptionStatus-Decryptedpassed=[]
Disk
EncryptionStatus-Decryptedfailed=DiskEncryptionDecryptedx64:DiskEncryptionDecryptedx86:DiskEncryptionDecrypted]
DiskEncryptionStatus-Decrypted_skipped=[]

0 Karma
Highlighted

Re: How to extract multikv field at search-time with dynamic field names from Cisco ISE events?

Path Finder

try to use rex command in your search like this:

 ...|rex "(?i).*?--\w+;\w+;Disk Encryption Status-Decrypted.(?P<FIELDNAME1>\w+[ ^]):(?P<FIELDNAME2>\w+[ ^]):(?P<FIELDNAME3>\w+[ ^])"|rex "Failed_Conditions.(?P<FIELDNAME4>Disk_Encryption_Decrypted_x\d\d:Disk_Encryption_Decrypted_x\d\d:Disk_Encryption_Decrypted_*x*\d*)" |rename FIELDNAME3 as Disk_Encryption_Status-Decrypted|....
0 Karma
Highlighted

Re: How to extract multikv field at search-time with dynamic field names from Cisco ISE events?

Builder

The field name for the tests need to by dynamic. A simple rename doesn't work, unless I can use the value of the field name. Splunk has confirmed that as of version 6.2 this cannot be done at search time.

0 Karma