<?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: Extracting specific parts from _raw logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652255#M225441</link>
    <description>&lt;P&gt;To extract patterns like &lt;FONT face="courier new,courier"&gt;":\s*(?&amp;lt;field1&amp;gt;[^;]+)[^:]+(?&amp;lt;field2&amp;gt;[^;]+)"&lt;/FONT&gt; (which is required for that type of data), rex has to scan character by character with an indeterministic presumption. &amp;nbsp;In comparison, &lt;FONT face="courier new,courier"&gt;pairdelim=";" kvdelim=":"&lt;/FONT&gt; simply scans for fixed strings ";" and ":", which is computationally less complex. (And less demanding in RAM.) &amp;nbsp;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;said, this does not mean that extract will always be more efficient or any choice will have material impact on performance. &amp;nbsp;But as a general practice, choose fixed pattern over regex. &amp;nbsp;The main advantage, of course, is that &lt;FONT face="courier new,courier"&gt;extract&lt;/FONT&gt; command extracts multiple kv pairs regardless of their order.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2023 16:42:55 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-07-27T16:42:55Z</dc:date>
    <item>
      <title>Extracting specific parts from _raw logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/642890#M222660</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Can anyone help me create a regex to extract the bolded parts from the following _raw log, please?&lt;/P&gt;&lt;P&gt;meta sequenceId="182311942"]10000 - [&lt;STRONG&gt;action:"Accept"&lt;/STRONG&gt;; ........; &lt;STRONG&gt;origin:"10.111.10.111"&lt;/STRONG&gt;; originsicname:"CN=................610;policy_name=High_Trust-1\]"; &lt;STRONG&gt;dst:"192.168.11.01"&lt;/STRONG&gt;; log_delay:"1683724684"; &lt;STRONG&gt;layer_name:"Some text"&lt;/STRONG&gt;; layer_name:"High_Trust-1 Application"; layer_uuid:"426c8a................."StoneBeat-Control"; &lt;STRONG&gt;src:"192.168.81.62"&lt;/STRONG&gt;]&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 16:39:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/642890#M222660</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-05-10T16:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific parts from _raw logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652171#M225419</link>
      <description>&lt;P&gt;After the extraction is complete, are you hoping to have fields and field values like the following?&lt;/P&gt;&lt;P&gt;action=Accept&lt;/P&gt;&lt;P&gt;origin=10.111.10.111&lt;/P&gt;&lt;P&gt;layer_name="Some text"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 04:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652171#M225419</guid>
      <dc:creator>cklunck</dc:creator>
      <dc:date>2023-07-27T04:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific parts from _raw logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652173#M225420</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;if above is true you could try this for all previous fields as own rex. When you’re using separate rex, then the order can change and you could add more fields later.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your base search&amp;gt;
| rex "action:\"(&amp;lt;?action&amp;gt;[^\"]+)"
| &amp;lt;next rex with another field name&amp;gt; …&lt;/LI-CODE&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 05:04:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652173#M225420</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-07-27T05:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific parts from _raw logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652174#M225421</link>
      <description>&lt;P&gt;It seems that your developers take pains to design a well formatted log. &amp;nbsp;It would be a waste to use regex for extraction. &amp;nbsp;Use &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Extract" target="_blank" rel="noopener"&gt;extract&lt;/A&gt; instead.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| extract pairdelim=";" kvdelim=":"&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 05:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652174#M225421</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-27T05:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific parts from _raw logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652179#M225423</link>
      <description>&lt;P&gt;Thanks for the reply &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/256817"&gt;@cklunck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Positive, this is what I want to achieve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 08:15:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652179#M225423</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-07-27T08:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific parts from _raw logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652180#M225424</link>
      <description>&lt;P&gt;Thanks for the update &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you please elaborate on the regex waste?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not so sure what you have in mind based on your experience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 08:17:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652180#M225424</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-07-27T08:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific parts from _raw logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652191#M225429</link>
      <description>&lt;P&gt;Just replace those all rex statements with this one. This will extract all those kv pairs.&lt;/P&gt;&lt;P&gt;Which option is more efficient can be check by Job Inspector.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 10:00:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652191#M225429</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-07-27T10:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting specific parts from _raw logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652255#M225441</link>
      <description>&lt;P&gt;To extract patterns like &lt;FONT face="courier new,courier"&gt;":\s*(?&amp;lt;field1&amp;gt;[^;]+)[^:]+(?&amp;lt;field2&amp;gt;[^;]+)"&lt;/FONT&gt; (which is required for that type of data), rex has to scan character by character with an indeterministic presumption. &amp;nbsp;In comparison, &lt;FONT face="courier new,courier"&gt;pairdelim=";" kvdelim=":"&lt;/FONT&gt; simply scans for fixed strings ";" and ":", which is computationally less complex. (And less demanding in RAM.) &amp;nbsp;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;said, this does not mean that extract will always be more efficient or any choice will have material impact on performance. &amp;nbsp;But as a general practice, choose fixed pattern over regex. &amp;nbsp;The main advantage, of course, is that &lt;FONT face="courier new,courier"&gt;extract&lt;/FONT&gt; command extracts multiple kv pairs regardless of their order.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 16:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-specific-parts-from-raw-logs/m-p/652255#M225441</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-27T16:42:55Z</dc:date>
    </item>
  </channel>
</rss>

