<?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: SEDCMD Regex need an SPL for testing purposes in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646314#M109941</link>
    <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"3. Testing using regex SPL commands might lead to confusion sometimes since you have to escape your regex to "fit" into a string."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Would it be possible to provide any practical examples, please? Apologies, I cannot fully understand.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2023 11:58:12 GMT</pubDate>
    <dc:creator>DanAlexander</dc:creator>
    <dc:date>2023-06-08T11:58:12Z</dc:date>
    <item>
      <title>Help with SEDCMD Regex SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646306#M109937</link>
      <description>&lt;P&gt;Hello clever people,&lt;/P&gt;
&lt;P&gt;Would anyone be able to help me build a regex that would work on a SPL level e.g something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| rex mode=sed field=_raw s/regex_example/g&lt;/P&gt;
&lt;P&gt;I wanted to test the result first before I add to props on the indexers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The below is the raw log and I would like to keep just the parts in bold all the rest should be dropped/cleared.&lt;/P&gt;
&lt;P&gt;-----------------------------------------------------&lt;/P&gt;
&lt;P&gt;[meta sequenceId="-2077347367"]10000 - [&lt;STRONG&gt;action:"Accept"&lt;/STRONG&gt;; conn_direction:"Internal"; flags:"dd06212"; ifdir:"inbound"; ifname:"bond3.32"; logid:"0"; loguid:"{ 000.000.000.000}"; &lt;STRONG&gt;origin:"000.000.000.000"&lt;/STRONG&gt;; originsicname:"CN=XXXXXXXX,O= XXXXXXXX. XXXXXXXX.q7vvv"; sequencenum:"1457"; time:"1686217674"; version:"5"; __policy_id_tag:"product=cccccccc-1[db_tag={ XXXXXXXX-8ED31 XXXXXXXX };mgmt= XXXXXXXX xxx1;date=168XXXXXXXX;policy_name=XXXXXXXX-1\]"; &lt;STRONG&gt;dst:"000.000.000.000"&lt;/STRONG&gt;; log_delay:"168XXXXXXXX "; &lt;STRONG&gt;layer_name:" XXXXXXXX "&lt;/STRONG&gt;; layer_name:" XXXXXXXX "; layer_uuid:" XXXXXXXX -49d7-a207-a90ea5dd66fb"; layer_uuid:"cdc569c2-d869- XXXXXXXX "; match_id:"14x"; match_id:"50331649"; parent_rule:"0"; parent_rule:"0"; rule_action:"Accept"; rule_action:"Accept"; rule_name:" XXXXXXXX Heartbeat -&amp;gt; Platfxxxx"; rule_name:" XXXXXXXX "; rule_uid:"211567a0-d33a- XXXXXXXX "; rule_uid:" XXXXXXXX -4bde-a9c0-3cbaefd188b6"; product:" XXXXXXXX "; proto:"6"; s_port:" XXXXXXXX "; service:"3002"; service_id:"xxxx-Control"; &lt;STRONG&gt;src:"000.000.000.000"&lt;/STRONG&gt;]&lt;/P&gt;
&lt;P&gt;-----------------------------------------------&lt;/P&gt;
&lt;P&gt;Thank you all in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 14:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646306#M109937</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-08T14:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646308#M109938</link>
      <description>&lt;P&gt;1. Use regex101.com for testing your regexes.&lt;/P&gt;&lt;P&gt;2. Test in pre-prod environment, test on mockup data and send to temporary index.&lt;/P&gt;&lt;P&gt;3. Testing using regex SPL commands might lead to confusion sometimes since you have to escape your regex to "fit" into a string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 11:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646308#M109938</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-06-08T11:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646311#M109939</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex mode=sed "s/.*\[(?&amp;lt;action&amp;gt;action:\"[^\"]+\").+(?&amp;lt;origin&amp;gt;origin:\"[^\"]+\").+(?&amp;lt;dst&amp;gt;dst:\"[^\"]+\").+(?&amp;lt;layer_name&amp;gt;layer_name:\"[^\"]+\").+(?&amp;lt;src&amp;gt;src:\"[^\"]+\").*/\1 \2 \3 \4 \5/g"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Jun 2023 11:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646311#M109939</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-08T11:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646313#M109940</link>
      <description>&lt;P&gt;Thanks for your reply&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, it gives me an error Unknown search command `db` after I run the following:&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval _raw = "[meta sequenceId="-2077347367"]10000 - [action:"Accept"; conn_direction:"Internal"; flags:"dd06212"; ifdir:"inbound"; ifname:"bond3.32"; logid:"0"; loguid:"{ 000.000.000.000}"; origin:"000.000.000.000"; originsicname:"CN=XXXXXXXX,O= XXXXXXXX. XXXXXXXX.q7vvv"; sequencenum:"1457"; time:"1686217674"; version:"5"; __policy_id_tag:"product=cccccccc-1[db_tag={ XXXXXXXX-8ED31 XXXXXXXX };mgmt= XXXXXXXX xxx1;date=168XXXXXXXX;policy_name=XXXXXXXX-1\]"; dst:"000.000.000.000"; log_delay:"168XXXXXXXX "; layer_name:" XXXXXXXX "; layer_name:" XXXXXXXX "; layer_uuid:" XXXXXXXX -49d7-a207-a90ea5dd66fb"; layer_uuid:"cdc569c2-d869- XXXXXXXX "; match_id:"14x"; match_id:"50331649"; parent_rule:"0"; parent_rule:"0"; rule_action:"Accept"; rule_action:"Accept"; rule_name:" XXXXXXXX Heartbeat -&amp;gt; Platfxxxx"; rule_name:" XXXXXXXX "; rule_uid:"211567a0-d33a- XXXXXXXX "; rule_uid:" XXXXXXXX -4bde-a9c0-3cbaefd188b6"; product:" XXXXXXXX "; proto:"6"; s_port:" XXXXXXXX "; service:"3002"; service_id:"xxxx-Control"; src:"000.000.000.000"]"&lt;BR /&gt;| rex mode=sed "s/.*\[(?&amp;lt;action&amp;gt;action:\"[^\"]+\").+(?&amp;lt;origin&amp;gt;origin:\"[^\"]+\").+(?&amp;lt;dst&amp;gt;dst:\"[^\"]+\").+(?&amp;lt;layer_name&amp;gt;layer_name:\"[^\"]+\").+(?&amp;lt;src&amp;gt;src:\"[^\"]+\").*/\1 \2 \3 \4 \5/g"&lt;/P&gt;&lt;P&gt;Would it be possible to provide all used to test, please?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 11:52:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646313#M109940</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-08T11:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646314#M109941</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"3. Testing using regex SPL commands might lead to confusion sometimes since you have to escape your regex to "fit" into a string."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Would it be possible to provide any practical examples, please? Apologies, I cannot fully understand.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 11:58:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646314#M109941</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-08T11:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646315#M109942</link>
      <description>&lt;P&gt;Normally if you want to perform - for example&lt;/P&gt;&lt;PRE&gt;s/"/|/g&lt;/PRE&gt;&lt;P&gt;You type it literarily in the SEDCMD definition&lt;/P&gt;&lt;P&gt;But if you want to use SPL, you have to escape the quotation mark so that doesn't end the string containing the regex. So it becomes&lt;/P&gt;&lt;PRE&gt;"s/\"/|/g"&lt;/PRE&gt;&lt;P&gt;And that's the simplest example. If you have multiple quotes and some backslashes in your regex, that might get messy and "disarming" all those escapes to get proper regex definition for SEDCMD might cause additional mistakes.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:08:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646315#M109942</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-06-08T12:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646317#M109943</link>
      <description>&lt;P&gt;I get this now. Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might create separate SEDCMD entries to avoid confusion and keep it simple?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:12:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646317#M109943</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-08T12:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646319#M109944</link>
      <description>&lt;P&gt;You need to escape the double quotes in the string you are setting _raw to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="[meta sequenceId=\"-2077347367\"]10000 - [action:\"Accept\"; conn_direction:\"Internal\"; flags:\"dd06212\"; ifdir:\"inbound\"; ifname:\"bond3.32\"; logid:\"0\"; loguid:\"{ 000.000.000.000}\"; origin:\"000.000.000.000\"; originsicname:\"CN=XXXXXXXX,O= XXXXXXXX. XXXXXXXX.q7vvv\"; sequencenum:\"1457\"; time:\"1686217674\"; version:\"5\"; __policy_id_tag:\"product=cccccccc-1[db_tag={ XXXXXXXX-8ED31 XXXXXXXX };mgmt= XXXXXXXX xxx1;date=168XXXXXXXX;policy_name=XXXXXXXX-1\]\"; dst:\"000.000.000.000\"; log_delay:\"168XXXXXXXX \"; layer_name:\" XXXXXXXX \"; layer_name:\" XXXXXXXX \"; layer_uuid:\" XXXXXXXX -49d7-a207-a90ea5dd66fb\"; layer_uuid:\"cdc569c2-d869- XXXXXXXX \"; match_id:\"14x\"; match_id:\"50331649\"; parent_rule:\"0\"; parent_rule:\"0\"; rule_action:\"Accept\"; rule_action:\"Accept\"; rule_name:\" XXXXXXXX Heartbeat -&amp;gt; Platfxxxx\"; rule_name:\" XXXXXXXX \"; rule_uid:\"211567a0-d33a- XXXXXXXX \"; rule_uid:\" XXXXXXXX -4bde-a9c0-3cbaefd188b6\"; product:\" XXXXXXXX \"; proto:\"6\"; s_port:\" XXXXXXXX \"; service:\"3002\"; service_id:\"xxxx-Control\"; src:\"000.000.000.000\"]"
| rex mode=sed "s/.*\[(?&amp;lt;action&amp;gt;action:\"[^\"]+\").+(?&amp;lt;origin&amp;gt;origin:\"[^\"]+\").+(?&amp;lt;dst&amp;gt;dst:\"[^\"]+\").+(?&amp;lt;layer_name&amp;gt;layer_name:\"[^\"]+\").+(?&amp;lt;src&amp;gt;src:\"[^\"]+\").*/\1 \2 \3 \4 \5/g"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646319#M109944</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-08T12:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646321#M109945</link>
      <description>&lt;P&gt;Thanks again&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just wanted to confirm that this is going to be the result after applying&amp;nbsp;&lt;/P&gt;&lt;P&gt;SEDCMD remove_unwanted_parts_from_raw_event=s/.*\[(?&amp;lt;action&amp;gt;action:\"[^\"]+\").+(?&amp;lt;origin&amp;gt;origin:\"[^\"]+\").+(?&amp;lt;dst&amp;gt;dst:\"[^\"]+\").+(?&amp;lt;layer_name&amp;gt;layer_name:\"[^\"]+\").+(?&amp;lt;src&amp;gt;src:\"[^\"]+\").*/\1 \2 \3 \4 \5/g&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;action:"Accept" origin:"000.000.000.000" dst:"000.000.000.000" layer_name:" XXXXXXXX " src:"000.000.000.000"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I just wanted to make sure the regex will extract the values I want to keep (above) and all the rest will be dropped before it gets indexed on the indexers and not the other way around?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:53:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646321#M109945</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-08T12:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646322#M109946</link>
      <description>&lt;P&gt;To be honest, I don't know for certain, but I think it should work. I don't usually get involved with the ingestion side of things. As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;suggests, you should test it before rolling it out to your production environment.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:58:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646322#M109946</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-08T12:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646424#M109953</link>
      <description>&lt;P&gt;That's why I suggested you check it in testing environment. At first glance it seems that you're trying to escape too much in your SEDCMD. While some characters will work the same way even if unnecessarily escaped, others may not.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 07:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646424#M109953</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-06-09T07:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD Regex need an SPL for testing purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646874#M110005</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Hope you are doing well.&lt;/P&gt;&lt;P&gt;I wanted to ask you as you were able to help me once and wanted to see if you would be able to help me with my new challenge, please.&lt;/P&gt;&lt;P&gt;My original post is in&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-raw-event-size-reduction/m-p/646837/highlight/false#M109996" target="_blank"&gt;Re: Help with SEDCMD raw event size reduction - Splunk Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 21:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-SEDCMD-Regex-SPL-for-testing-purposes/m-p/646874#M110005</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-06-13T21:38:57Z</dc:date>
    </item>
  </channel>
</rss>

