<?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: Dynamic field extraction with regex syslog's in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Dynamic-field-extraction-with-regex-syslog-s/m-p/633269#M15586</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;extract&lt;/FONT&gt; command is made for that kind of parsing, but it will be tripped up by the extra ":" separators in the timestamp.&lt;/P&gt;&lt;P&gt;Regex will do the job, however, but there's no special command for it.&amp;nbsp; Assuming the fields are always in the same order then this will do it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "firepower : (?&amp;lt;firepower&amp;gt;[^:]+): EventPriority: (?&amp;lt;EventPriority&amp;gt;\w+), DeviceUUID: (?&amp;lt;DeviceUUID&amp;gt;[^,]+), InstanceID: (?&amp;lt;InstanceID&amp;gt;[^,]+), FirstPacketSecond: (?&amp;lt;FirstPacketSecond&amp;gt;[^,]+), ConnectionID: (?&amp;lt;ConnectionID&amp;gt;[^,]+), AccessControlRuleAction: (?&amp;lt;AccessControlRuleAction&amp;gt;[^,]+), SrcIP: (?&amp;lt;SrcIP&amp;gt;[^,]+), DstIP: (?&amp;lt;DstIP&amp;gt;[^,]+), SrcPort: (?&amp;lt;SrcPort&amp;gt;\d+), DstPort: (?&amp;lt;DstPort&amp;gt;\d+), Protocol: \w+"&lt;/LI-CODE&gt;&lt;P&gt;If the fields might appear in any order then a separate &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command is needed for each one.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Mar 2023 01:33:10 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2023-03-04T01:33:10Z</dc:date>
    <item>
      <title>Dynamic field extraction with regex syslog's?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Dynamic-field-extraction-with-regex-syslog-s/m-p/633261#M15584</link>
      <description>&lt;P&gt;We are ingesting Firepower logs via syslog using the cisco:asa TA. Many of the events I am interested in are Threat Defense events that are tied to an ID like this&amp;nbsp;FTD-6-430002. When I narrow down my search to events with just that ID I find the rest of the event has plenty of info in key:value pairs but no fields have been extracted from the pairs.&lt;BR /&gt;&lt;BR /&gt;Sanitized example event:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Mar&lt;/SPAN&gt; &lt;SPAN class=""&gt;3&lt;/SPAN&gt; &lt;SPAN class=""&gt;16:01:21&lt;/SPAN&gt; &lt;SPAN class=""&gt;172.16.51.72&lt;/SPAN&gt; &lt;SPAN class=""&gt;Mar&lt;/SPAN&gt; &lt;SPAN class=""&gt;03&lt;/SPAN&gt; &lt;SPAN class=""&gt;2023&lt;/SPAN&gt; &lt;SPAN class=""&gt;22:01:21&lt;/SPAN&gt;&amp;nbsp;firepower&amp;nbsp;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;%FTD-6-430002&lt;/SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;EventPriority:&lt;/SPAN&gt; &lt;SPAN class=""&gt;Low&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;DeviceUUID:&lt;/SPAN&gt; &lt;SPAN class=""&gt;00000-0000-0000-000000000000&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;InstanceID:&lt;/SPAN&gt; &lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;FirstPacketSecond:&lt;/SPAN&gt; &lt;SPAN class=""&gt;2023-03-03T22:01:21Z&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;ConnectionID:&lt;/SPAN&gt; &lt;SPAN class=""&gt;5000&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;AccessControlRuleAction:&lt;/SPAN&gt; &lt;SPAN class=""&gt;Allow&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;SrcIP:&lt;/SPAN&gt; &lt;SPAN class=""&gt;100.100.100.100&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;DstIP:&lt;/SPAN&gt;&amp;nbsp;200&lt;SPAN class=""&gt;.200.200.200&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;SrcPort:&lt;/SPAN&gt; &lt;SPAN class=""&gt;60000&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;DstPort:&lt;/SPAN&gt;&amp;nbsp;10&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;Protocol:&lt;/SPAN&gt; &lt;SPAN class=""&gt;tcp&lt;BR /&gt;&lt;BR /&gt;Is there a regex command that can dynamically extract all the field names from something like "DstPort:&amp;nbsp;10" to Field Name of DstPort with a value of 10?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I know Cisco provides a eStreamer TA that may extract these fields but it looks very involved to setup and I already have the syslog configured.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 14:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Dynamic-field-extraction-with-regex-syslog-s/m-p/633261#M15584</guid>
      <dc:creator>snix</dc:creator>
      <dc:date>2023-03-06T14:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field extraction with regex syslog's</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Dynamic-field-extraction-with-regex-syslog-s/m-p/633269#M15586</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;extract&lt;/FONT&gt; command is made for that kind of parsing, but it will be tripped up by the extra ":" separators in the timestamp.&lt;/P&gt;&lt;P&gt;Regex will do the job, however, but there's no special command for it.&amp;nbsp; Assuming the fields are always in the same order then this will do it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "firepower : (?&amp;lt;firepower&amp;gt;[^:]+): EventPriority: (?&amp;lt;EventPriority&amp;gt;\w+), DeviceUUID: (?&amp;lt;DeviceUUID&amp;gt;[^,]+), InstanceID: (?&amp;lt;InstanceID&amp;gt;[^,]+), FirstPacketSecond: (?&amp;lt;FirstPacketSecond&amp;gt;[^,]+), ConnectionID: (?&amp;lt;ConnectionID&amp;gt;[^,]+), AccessControlRuleAction: (?&amp;lt;AccessControlRuleAction&amp;gt;[^,]+), SrcIP: (?&amp;lt;SrcIP&amp;gt;[^,]+), DstIP: (?&amp;lt;DstIP&amp;gt;[^,]+), SrcPort: (?&amp;lt;SrcPort&amp;gt;\d+), DstPort: (?&amp;lt;DstPort&amp;gt;\d+), Protocol: \w+"&lt;/LI-CODE&gt;&lt;P&gt;If the fields might appear in any order then a separate &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command is needed for each one.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2023 01:33:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Dynamic-field-extraction-with-regex-syslog-s/m-p/633269#M15586</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-03-04T01:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic field extraction with regex syslog's</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Dynamic-field-extraction-with-regex-syslog-s/m-p/633481#M15604</link>
      <description>&lt;P&gt;Thank you! Yeah I was hoping there was a way to just pull the filed name from the event automatically but for what I need it for right now I just need a few fields.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Yeah the events seem to vary a bit on what fields are included and not included so I opted to take your second suggestion and spit them up and that worked like a charm:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "AccessControlRuleAction: (?&amp;lt;AccessControlRuleAction&amp;gt;[^,]+)" 
| rex "SrcIP: (?&amp;lt;SrcIP&amp;gt;[^,]+)" 
| rex "DstIP: (?&amp;lt;DstIP&amp;gt;[^,]+)" 
| rex "DstPort: (?&amp;lt;DstPort&amp;gt;[^,]+)" &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 20:28:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Dynamic-field-extraction-with-regex-syslog-s/m-p/633481#M15604</guid>
      <dc:creator>snix</dc:creator>
      <dc:date>2023-03-06T20:28:34Z</dc:date>
    </item>
  </channel>
</rss>

