<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Combining events over time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combining-events-over-time/m-p/710896#M240069</link>
    <description>&lt;P&gt;First, when posting type 2 which is in JSON, please use raw text. &amp;nbsp;Splunk's "syntax highlights" view is non-compliant and very difficult to process. (See the crazy rex in my emulation below; you also introduced additional syntax errors when attempting to simplify or anonymize.) &amp;nbsp;Also in type 2, you should preserve the uuid's value as that's the only key that distinguishes between the two. &amp;nbsp;For everyone's benefit, I'm posting reconstructed raw events from type 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{ 
"@message": { 
"attributeContract": { 
"extendedAttributes": [ 
],
"maskOgnlValues": false,
"uniqueUserKeyAttribute": "uuid"
},
"attributeMapping": { 
"attributeContractFulfillment": { 
"uuid": { 
"source": { 
"type": "ADAPTER"
},
"value": "9c5b94b1-35ad-49bb-b118-8e8fc24abf80"
}
},
"attributeSources": [ 
],
"issuanceCriteria": { 
"conditionalCriteria": [ 
]
}
},
"configuration": { 
"fields": [ 
{ 
"name": "Application ObjectClass",
"value": "cartmanUser"
},
{ 
"name": "Application Entitlement Attribute",
"value": "cartmanRole"
},
{ 
"name": "IAL to Enforce",
"value": 2
}
],
"id": "Cartman",
"name": "Cartman"
}
},
"@timestamp": "2025-01-01T00:00:01.833685"
}

{ 
"@message": { 
"attributeContract": { 
"extendedAttributes": [ 
],
"maskOgnlValues": false,
"uniqueUserKeyAttribute": "uuid"
},
"attributeMapping": { 
"attributeContractFulfillment": { 
"uuid": { 
"source": { 
"type": "ADAPTER"
},
"value": "550e8400-e29b-41d4-a716-446655440000"
}
},
"attributeSources": [ 
],
"issuanceCriteria": { 
"conditionalCriteria": [ 
]
}
},
"configuration": { 
"fields": [ 
{ 
"name": "Application ObjectClass",
"value": "cartmanUser"
},
{ 
"name": "Application Entitlement Attribute",
"value": "cartmanRole"
},
{ 
"name": "IAL to Enforce",
"value": 1
}
],
"id": "Cartman",
"name": "Cartman"
}
},
"@timestamp": "2025-01-02T00:00:01.833685"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;, I fail to see see the relevance of type 1. &amp;nbsp;Type 2 is all you need to produce the results you want. &amp;nbsp;I also don't see why you want to print two tables rather than printing one table with two rows (differentiated by UUID). &amp;nbsp;So, this is what I'm going to show.&lt;/P&gt;&lt;P&gt;Actual code is pretty simple. &amp;nbsp;My main time was sunken in reconstruct valid JSON data from your pasted text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields @message.attributeMapping.attributeContractFulfillment.uuid.value
``` ^^^ this line is just to declutter output ```
| spath path=@message.configuration.fields{}
| eval restructured_fields = json_object()
| foreach @message.configuration.fields{} mode=multivalue
    [eval restructured_fields = json_set(restructured_fields,
     json_extract(&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;, "name"), json_extract(&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;, "value"))]
| spath input=restructured_fields&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(This foreach syntax above requires Splunk 9.0.) &amp;nbsp;Output from the two reconstructed events is as follows:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="532px"&gt;&lt;BR /&gt;@message.attributeMapping.attributeContractFulfillment.uuid.value&lt;/TD&gt;&lt;TD width="104.0625px"&gt;Application Entitlement Attribute&lt;/TD&gt;&lt;TD width="105.296875px"&gt;Application ObjectClass&lt;/TD&gt;&lt;TD width="43.65625px"&gt;IAL to Enforce&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="532px"&gt;9c5b94b1-35ad-49bb-b118-8e8fc24abf80&lt;/TD&gt;&lt;TD width="104.0625px"&gt;cartmanRole&lt;/TD&gt;&lt;TD width="105.296875px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="43.65625px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="532px"&gt;550e8400-e29b-41d4-a716-446655440000&lt;/TD&gt;&lt;TD width="104.0625px"&gt;cartmanRole&lt;/TD&gt;&lt;TD width="105.296875px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="43.65625px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Does this satisfy your requirements?&lt;/P&gt;&lt;P&gt;It is useful to print out the two intermediate JSON objects used in this search so you can clearly see dataflow:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="302.984375px" height="25px"&gt;&lt;DIV class=""&gt;@message.configuration.fields{}&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="482.03125px" height="25px"&gt;restructured_fields&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="302.984375px" height="113px"&gt;&lt;DIV class=""&gt;{ "name": "Application ObjectClass", "value": "cartmanUser" }&lt;/DIV&gt;&lt;DIV class=""&gt;{ "name": "Application Entitlement Attribute", "value": "cartmanRole" }&lt;/DIV&gt;&lt;DIV class=""&gt;{ "name": "IAL to Enforce", "value": 2 }&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="482.03125px" height="113px"&gt;{"Application ObjectClass":"cartmanUser","Application Entitlement Attribute":"cartmanRole","IAL to Enforce":2}&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="302.984375px" height="113px"&gt;&lt;DIV class=""&gt;{ "name": "Application ObjectClass", "value": "cartmanUser" }&lt;/DIV&gt;&lt;DIV class=""&gt;{ "name": "Application Entitlement Attribute", "value": "cartmanRole" }&lt;/DIV&gt;&lt;DIV class=""&gt;{ "name": "IAL to Enforce", "value": 1 }&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="482.03125px" height="113px"&gt;{"Application ObjectClass":"cartmanUser","Application Entitlement Attribute":"cartmanRole","IAL to Enforce":1}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;@message.configuration.fields{}, of source, is extracted directly from raw data.&lt;/P&gt;&lt;P&gt;Here is an emulation for you to play with and compare with real data type 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval sourcetype = "type2", data = mvappend("{ [-]
@message: { [-]
attributeContract: { [-]
extendedAttributes: [ [-]
]
maskOgnlValues: false
uniqueUserKeyAttribute: uuid
}
attributeMapping: { [-]
attributeContractFulfillment: { [-]
uuid: { [-]
source: { [-]
type: ADAPTER
}
value: 9c5b94b1-35ad-49bb-b118-8e8fc24abf80
}
}
attributeSources: [ [-]
]
issuanceCriteria: { [-]
conditionalCriteria: [ [-]
]
}
}
configuration: { [-]
fields: [ [-]
{ [-]
name: Application ObjectClass
value: cartmanUser
}
{ [-]
name: Application Entitlement Attribute
value: cartmanRole
}
{ [-]
name: IAL to Enforce
value: 2
}
]
id: Cartman
name: Cartman
}
}
@timestamp: 2025-01-01T00:00:01.833685
}",
"{ [-]
@message: { [-]
attributeContract: { [-]
extendedAttributes: [ [-]
]
maskOgnlValues: false
uniqueUserKeyAttribute: uuid
}
attributeMapping: { [-]
attributeContractFulfillment: { [-]
uuid: { [-]
source: { [-]
type: ADAPTER
}
value: 550e8400-e29b-41d4-a716-446655440000
}
}
attributeSources: [ [-]
]
issuanceCriteria: { [-]
conditionalCriteria: [ [-]
]
}
}
configuration: { [-]
fields: [ [-]
{ [-]
name: Application ObjectClass
value: cartmanUser
}
{ [-]
name: Application Entitlement Attribute
value: cartmanRole
}
{ [-]
name: IAL to Enforce
value: 1
}
]
id: Cartman
name: Cartman
}
}
@timestamp: 2025-01-02T00:00:01.833685
}")
| rex field=data mode=sed "s/\[-]//g s/\n+([\w@])/\n\"\1/g s/([^\"]): (true|false|\d+\n)/\1\": \2/g
  s/([^\"]):(\W+\n)/\1\":\2/g s/([^\"]): (.+)/\1\": \"\2\"/g s/([\w\"}\]])\n([\"{\[])/\1,\n\2/g"
| mvexpand data
| rename data AS _raw
| spath
``` data type 2 emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;(Can you see how crazy that rex command is?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For completeness, this is how you extract data from type 1 in case it is of use to you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval message = replace(message, "'", "")
| spath input=message&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;message field should have been present at search type. &amp;nbsp;The result from your sample data is&lt;/P&gt;&lt;TABLE width="669px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;UserAccessSubmission.csp&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;UserAccessSubmission.mail&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;UserAccessSubmission.objectClass&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;UserAccessSubmission.trackingId&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;UserAccessSubmission.uuid&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;sourcetype&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;trackingid&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;StanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;StanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;This is emulation of data type 1 used to extract the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval sourcetype = "type1", data = split("2025-01-01 00:00:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"cartmanUser\",\"csp\":\"Butters\"}}'
2025-01-01 00:01:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"cartmanUser\",\"csp\":\"Butters\"}}'
2025-01-02 00:01:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"cartmanUser\",\"csp\":\"Butters\"}}'
2025-01-02 00:01:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"StanUser\",\"csp\":\"Butters\"}}'
2025-01-02 00:01:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"StanUser\",\"csp\":\"Butters\"}}'", "
")
| mvexpand data
| rename data AS _raw
| extract
``` data type 1 emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2025 08:34:20 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2025-02-07T08:34:20Z</dc:date>
    <item>
      <title>Combining events over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-events-over-time/m-p/710875#M240065</link>
      <description>&lt;P&gt;I am not sure where to even start on this one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 log file types I need to extract data to get final accounts. I need to combine by objectClasses so that when on a given day "ial to enforce" in log Type 2 is sets the count for number of Type 1 events. I need to run this over a year. Thank you in advance!!!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;-----Type 1&lt;/P&gt;&lt;P&gt;2025-01-01 00:00:00,125 trackingid="tid:13256464"message='{"UserAccessSubmission":{"uuid":"abc123","mail":"sean@southpark.net","trackingId":"tid:13256464","objectClass":"cartmanUser","csp":"Butters"}}'&lt;BR /&gt;2025-01-01 00:01:00,125 trackingid="tid:13256464"message='{"UserAccessSubmission":{"uuid":"abc123","mail":"sean@southpark.net","trackingId":"tid:13256464","objectClass":"cartmanUser","csp":"Butters"}}'&lt;/P&gt;&lt;P&gt;2025-01-02 00:01:00,125 trackingid="tid:13256464"message='{"UserAccessSubmission":{"uuid":"abc123","mail":"sean@southpark.net","trackingId":"tid:13256464","objectClass":"cartmanUser","csp":"Butters"}}'&lt;/P&gt;&lt;P&gt;2025-01-02 00:01:00,125 trackingid="tid:13256464"message='{"UserAccessSubmission":{"uuid":"abc123","mail":"sean@southpark.net","trackingId":"tid:13256464","objectClass":"StanUser","csp":"Butters"}}'&lt;/P&gt;&lt;P&gt;2025-01-02 00:01:00,125 trackingid="tid:13256464"message='{"UserAccessSubmission":{"uuid":"abc123","mail":"sean@southpark.net","trackingId":"tid:13256464","objectClass":"StanUser","csp":"Butters"}}'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;------- Type 2&lt;/P&gt;&lt;P&gt;{ [-]&lt;BR /&gt;@message: { [-]&lt;BR /&gt;attributeContract: { [-]&lt;BR /&gt;extendedAttributes: [ [-]&lt;BR /&gt;]&lt;BR /&gt;maskOgnlValues: false&lt;BR /&gt;uniqueUserKeyAttribute: uuid&lt;BR /&gt;}&lt;BR /&gt;attributeMapping: { [-]&lt;BR /&gt;attributeContractFulfillment: { [-]&lt;BR /&gt;uuid: { [-]&lt;BR /&gt;source: { [-]&lt;BR /&gt;type: ADAPTER&lt;BR /&gt;}&lt;BR /&gt;value: uuid&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;attributeSources: [ [-]&lt;BR /&gt;]&lt;BR /&gt;issuanceCriteria: { [-]&lt;BR /&gt;conditionalCriteria: [ [-]&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;configuration: { [-]&lt;BR /&gt;fields: [ [-]&lt;BR /&gt;{ [-]&lt;BR /&gt;name: Application ObjectClass&lt;BR /&gt;value: cartmanUser&lt;BR /&gt;}&lt;BR /&gt;{ [-]&lt;BR /&gt;name: Application Entitlement Attribute&lt;BR /&gt;value: cartmanRole&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;{ [-]&lt;BR /&gt;name: IAL to Enforce&lt;BR /&gt;value: 2&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;id: Cartman&lt;BR /&gt;name: Cartman&lt;BR /&gt;}&lt;BR /&gt;@timestamp: 2025-01-01T00:00:01.833685&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{ [-]&lt;BR /&gt;@message: { [-]&lt;BR /&gt;attributeContract: { [-]&lt;BR /&gt;extendedAttributes: [ [-]&lt;BR /&gt;]&lt;BR /&gt;maskOgnlValues: false&lt;BR /&gt;uniqueUserKeyAttribute: uuid&lt;BR /&gt;}&lt;BR /&gt;attributeMapping: { [-]&lt;BR /&gt;attributeContractFulfillment: { [-]&lt;BR /&gt;uuid: { [-]&lt;BR /&gt;source: { [-]&lt;BR /&gt;type: ADAPTER&lt;BR /&gt;}&lt;BR /&gt;value: uuid&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;attributeSources: [ [-]&lt;BR /&gt;]&lt;BR /&gt;issuanceCriteria: { [-]&lt;BR /&gt;conditionalCriteria: [ [-]&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;configuration: { [-]&lt;BR /&gt;fields: [ [-]&lt;BR /&gt;{ [-]&lt;BR /&gt;name: Application ObjectClass&lt;BR /&gt;value: cartmanUser&lt;BR /&gt;}&lt;BR /&gt;{ [-]&lt;BR /&gt;name: Application Entitlement Attribute&lt;BR /&gt;value: cartmanRole&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;{ [-]&lt;BR /&gt;name: IAL to Enforce&lt;BR /&gt;value: 1&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;id: Cartman&lt;BR /&gt;name: Cartman&lt;BR /&gt;}&lt;BR /&gt;@timestamp: 2025-01-02T00:00:01.833685&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Goal would be to get something like this&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Table 1&lt;/P&gt;&lt;TABLE width="208"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="91"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="117"&gt;Ial to enforce is 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CartmanUser&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2&lt;/P&gt;&lt;TABLE width="208"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="91"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="117"&gt;Ial to enforce is 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CartmanUser&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 00:43:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-events-over-time/m-p/710875#M240065</guid>
      <dc:creator>jparso09</dc:creator>
      <dc:date>2025-02-07T00:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Combining events over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-events-over-time/m-p/710881#M240066</link>
      <description>&lt;P&gt;I'm not clear on what the data in type 1 is used for. You have object class in type 2 source as well as type 1 - I assume CartmanUser is meant to be cartmanUser&lt;/P&gt;&lt;P&gt;What are the IAL to enforce values 1 and 2 supposed to correlate to, to give you the 1 and 2 in your tables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 03:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-events-over-time/m-p/710881#M240066</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-02-07T03:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Combining events over time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-events-over-time/m-p/710896#M240069</link>
      <description>&lt;P&gt;First, when posting type 2 which is in JSON, please use raw text. &amp;nbsp;Splunk's "syntax highlights" view is non-compliant and very difficult to process. (See the crazy rex in my emulation below; you also introduced additional syntax errors when attempting to simplify or anonymize.) &amp;nbsp;Also in type 2, you should preserve the uuid's value as that's the only key that distinguishes between the two. &amp;nbsp;For everyone's benefit, I'm posting reconstructed raw events from type 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{ 
"@message": { 
"attributeContract": { 
"extendedAttributes": [ 
],
"maskOgnlValues": false,
"uniqueUserKeyAttribute": "uuid"
},
"attributeMapping": { 
"attributeContractFulfillment": { 
"uuid": { 
"source": { 
"type": "ADAPTER"
},
"value": "9c5b94b1-35ad-49bb-b118-8e8fc24abf80"
}
},
"attributeSources": [ 
],
"issuanceCriteria": { 
"conditionalCriteria": [ 
]
}
},
"configuration": { 
"fields": [ 
{ 
"name": "Application ObjectClass",
"value": "cartmanUser"
},
{ 
"name": "Application Entitlement Attribute",
"value": "cartmanRole"
},
{ 
"name": "IAL to Enforce",
"value": 2
}
],
"id": "Cartman",
"name": "Cartman"
}
},
"@timestamp": "2025-01-01T00:00:01.833685"
}

{ 
"@message": { 
"attributeContract": { 
"extendedAttributes": [ 
],
"maskOgnlValues": false,
"uniqueUserKeyAttribute": "uuid"
},
"attributeMapping": { 
"attributeContractFulfillment": { 
"uuid": { 
"source": { 
"type": "ADAPTER"
},
"value": "550e8400-e29b-41d4-a716-446655440000"
}
},
"attributeSources": [ 
],
"issuanceCriteria": { 
"conditionalCriteria": [ 
]
}
},
"configuration": { 
"fields": [ 
{ 
"name": "Application ObjectClass",
"value": "cartmanUser"
},
{ 
"name": "Application Entitlement Attribute",
"value": "cartmanRole"
},
{ 
"name": "IAL to Enforce",
"value": 1
}
],
"id": "Cartman",
"name": "Cartman"
}
},
"@timestamp": "2025-01-02T00:00:01.833685"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;, I fail to see see the relevance of type 1. &amp;nbsp;Type 2 is all you need to produce the results you want. &amp;nbsp;I also don't see why you want to print two tables rather than printing one table with two rows (differentiated by UUID). &amp;nbsp;So, this is what I'm going to show.&lt;/P&gt;&lt;P&gt;Actual code is pretty simple. &amp;nbsp;My main time was sunken in reconstruct valid JSON data from your pasted text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields @message.attributeMapping.attributeContractFulfillment.uuid.value
``` ^^^ this line is just to declutter output ```
| spath path=@message.configuration.fields{}
| eval restructured_fields = json_object()
| foreach @message.configuration.fields{} mode=multivalue
    [eval restructured_fields = json_set(restructured_fields,
     json_extract(&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;, "name"), json_extract(&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;, "value"))]
| spath input=restructured_fields&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(This foreach syntax above requires Splunk 9.0.) &amp;nbsp;Output from the two reconstructed events is as follows:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="532px"&gt;&lt;BR /&gt;@message.attributeMapping.attributeContractFulfillment.uuid.value&lt;/TD&gt;&lt;TD width="104.0625px"&gt;Application Entitlement Attribute&lt;/TD&gt;&lt;TD width="105.296875px"&gt;Application ObjectClass&lt;/TD&gt;&lt;TD width="43.65625px"&gt;IAL to Enforce&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="532px"&gt;9c5b94b1-35ad-49bb-b118-8e8fc24abf80&lt;/TD&gt;&lt;TD width="104.0625px"&gt;cartmanRole&lt;/TD&gt;&lt;TD width="105.296875px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="43.65625px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="532px"&gt;550e8400-e29b-41d4-a716-446655440000&lt;/TD&gt;&lt;TD width="104.0625px"&gt;cartmanRole&lt;/TD&gt;&lt;TD width="105.296875px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="43.65625px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Does this satisfy your requirements?&lt;/P&gt;&lt;P&gt;It is useful to print out the two intermediate JSON objects used in this search so you can clearly see dataflow:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="302.984375px" height="25px"&gt;&lt;DIV class=""&gt;@message.configuration.fields{}&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="482.03125px" height="25px"&gt;restructured_fields&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="302.984375px" height="113px"&gt;&lt;DIV class=""&gt;{ "name": "Application ObjectClass", "value": "cartmanUser" }&lt;/DIV&gt;&lt;DIV class=""&gt;{ "name": "Application Entitlement Attribute", "value": "cartmanRole" }&lt;/DIV&gt;&lt;DIV class=""&gt;{ "name": "IAL to Enforce", "value": 2 }&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="482.03125px" height="113px"&gt;{"Application ObjectClass":"cartmanUser","Application Entitlement Attribute":"cartmanRole","IAL to Enforce":2}&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="302.984375px" height="113px"&gt;&lt;DIV class=""&gt;{ "name": "Application ObjectClass", "value": "cartmanUser" }&lt;/DIV&gt;&lt;DIV class=""&gt;{ "name": "Application Entitlement Attribute", "value": "cartmanRole" }&lt;/DIV&gt;&lt;DIV class=""&gt;{ "name": "IAL to Enforce", "value": 1 }&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="482.03125px" height="113px"&gt;{"Application ObjectClass":"cartmanUser","Application Entitlement Attribute":"cartmanRole","IAL to Enforce":1}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;@message.configuration.fields{}, of source, is extracted directly from raw data.&lt;/P&gt;&lt;P&gt;Here is an emulation for you to play with and compare with real data type 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval sourcetype = "type2", data = mvappend("{ [-]
@message: { [-]
attributeContract: { [-]
extendedAttributes: [ [-]
]
maskOgnlValues: false
uniqueUserKeyAttribute: uuid
}
attributeMapping: { [-]
attributeContractFulfillment: { [-]
uuid: { [-]
source: { [-]
type: ADAPTER
}
value: 9c5b94b1-35ad-49bb-b118-8e8fc24abf80
}
}
attributeSources: [ [-]
]
issuanceCriteria: { [-]
conditionalCriteria: [ [-]
]
}
}
configuration: { [-]
fields: [ [-]
{ [-]
name: Application ObjectClass
value: cartmanUser
}
{ [-]
name: Application Entitlement Attribute
value: cartmanRole
}
{ [-]
name: IAL to Enforce
value: 2
}
]
id: Cartman
name: Cartman
}
}
@timestamp: 2025-01-01T00:00:01.833685
}",
"{ [-]
@message: { [-]
attributeContract: { [-]
extendedAttributes: [ [-]
]
maskOgnlValues: false
uniqueUserKeyAttribute: uuid
}
attributeMapping: { [-]
attributeContractFulfillment: { [-]
uuid: { [-]
source: { [-]
type: ADAPTER
}
value: 550e8400-e29b-41d4-a716-446655440000
}
}
attributeSources: [ [-]
]
issuanceCriteria: { [-]
conditionalCriteria: [ [-]
]
}
}
configuration: { [-]
fields: [ [-]
{ [-]
name: Application ObjectClass
value: cartmanUser
}
{ [-]
name: Application Entitlement Attribute
value: cartmanRole
}
{ [-]
name: IAL to Enforce
value: 1
}
]
id: Cartman
name: Cartman
}
}
@timestamp: 2025-01-02T00:00:01.833685
}")
| rex field=data mode=sed "s/\[-]//g s/\n+([\w@])/\n\"\1/g s/([^\"]): (true|false|\d+\n)/\1\": \2/g
  s/([^\"]):(\W+\n)/\1\":\2/g s/([^\"]): (.+)/\1\": \"\2\"/g s/([\w\"}\]])\n([\"{\[])/\1,\n\2/g"
| mvexpand data
| rename data AS _raw
| spath
``` data type 2 emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;(Can you see how crazy that rex command is?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For completeness, this is how you extract data from type 1 in case it is of use to you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval message = replace(message, "'", "")
| spath input=message&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;message field should have been present at search type. &amp;nbsp;The result from your sample data is&lt;/P&gt;&lt;TABLE width="669px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;UserAccessSubmission.csp&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;UserAccessSubmission.mail&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;UserAccessSubmission.objectClass&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;UserAccessSubmission.trackingId&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;UserAccessSubmission.uuid&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;sourcetype&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;trackingid&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;cartmanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;StanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="208.71875px" height="25px"&gt;Butters&lt;/TD&gt;&lt;TD width="212.8125px" height="25px"&gt;sean@southpark.net&lt;/TD&gt;&lt;TD width="105.296875px" height="25px"&gt;StanUser&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;TD width="66.734375px" height="25px"&gt;abc123&lt;/TD&gt;&lt;TD width="53px" height="25px"&gt;type1&lt;/TD&gt;&lt;TD width="110.015625px" height="25px"&gt;tid:13256464&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;This is emulation of data type 1 used to extract the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval sourcetype = "type1", data = split("2025-01-01 00:00:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"cartmanUser\",\"csp\":\"Butters\"}}'
2025-01-01 00:01:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"cartmanUser\",\"csp\":\"Butters\"}}'
2025-01-02 00:01:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"cartmanUser\",\"csp\":\"Butters\"}}'
2025-01-02 00:01:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"StanUser\",\"csp\":\"Butters\"}}'
2025-01-02 00:01:00,125 trackingid=\"tid:13256464\"message='{\"UserAccessSubmission\":{\"uuid\":\"abc123\",\"mail\":\"sean@southpark.net\",\"trackingId\":\"tid:13256464\",\"objectClass\":\"StanUser\",\"csp\":\"Butters\"}}'", "
")
| mvexpand data
| rename data AS _raw
| extract
``` data type 1 emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 08:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-events-over-time/m-p/710896#M240069</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-02-07T08:34:20Z</dc:date>
    </item>
  </channel>
</rss>

