<?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 Help with extracting specific symbols/text from raw log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642916#M222671</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;some text - [&lt;STRONG&gt;action:"Accept"&lt;/STRONG&gt;; some text ;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;origin:"10.111.10.111"&lt;/STRONG&gt;; some text]";&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;dst:"192.168.11.01"&lt;/STRONG&gt;; some text684";&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;layer_name:"Some text"&lt;/STRONG&gt;; layer_nsome text";&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&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 20:43:34 GMT</pubDate>
    <dc:creator>DanAlexander</dc:creator>
    <dc:date>2023-05-10T20:43:34Z</dc:date>
    <item>
      <title>Help with extracting specific symbols/text from raw log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642916#M222671</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;some text - [&lt;STRONG&gt;action:"Accept"&lt;/STRONG&gt;; some text ;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;origin:"10.111.10.111"&lt;/STRONG&gt;; some text]";&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;dst:"192.168.11.01"&lt;/STRONG&gt;; some text684";&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;layer_name:"Some text"&lt;/STRONG&gt;; layer_nsome text";&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&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 20:43:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642916#M222671</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-05-10T20:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with extracting specific symbols/text from raw log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642918#M222672</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240690"&gt;@DanAlexander&lt;/a&gt;&amp;nbsp;, try this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| rex field=_raw "action:"(?&amp;lt;Action&amp;gt;.*)";"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| rex field=_raw "origin:"(?&amp;lt;Origin&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| rex field=_raw "dst:"(?&amp;lt;Dest&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| rex field=_raw "layer_name:"(?&amp;lt;Text&amp;gt;\w+)"" ***i'm assuming some text doesnt contain whitespaces, if does, I would try to test with&amp;nbsp;[\s\S]+)";&amp;lt;add data pattern here so it limits the expression&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| rex field=_raw "src:"(?&amp;lt;Source&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tested on regxr and seems to be working and extracting the fields as it should.&lt;/P&gt;&lt;P&gt;input:&amp;nbsp;action:"(?&amp;lt;Action&amp;gt;\w+)"|origin:"(?&amp;lt;Origin&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"|layer_name:"(?&amp;lt;Text&amp;gt;\w+)"|dst:"(?&amp;lt;dest&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"|src:"(?&amp;lt;Source&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"&lt;/P&gt;&lt;P&gt;test: (your log example)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;notes:&lt;/P&gt;&lt;P&gt;*i can't remember if we are able to "bundle" all of these rex extractions into a single command, try to separate quoted expressions using a comma&lt;/P&gt;&lt;P&gt;*for text data, the best way would be using a specific number of characters such as \w{n,m} (a number of characters that could be between n and m.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 21:26:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642918#M222672</guid>
      <dc:creator>enzomialich</dc:creator>
      <dc:date>2023-05-10T21:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with extracting specific symbols/text from raw log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642919#M222673</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240690"&gt;@DanAlexander&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'd suggest using the extract command instead on rex as there is a regular pattern for the key value pairs.&amp;nbsp; Here's a run anywhere example...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dummy
| append [| makeresults | eval _raw="some text - [action:\"Accept\"; some text ; origin:\"10.111.10.111\"; some text]; dst:\"192.168.11.01\"; some text684\"; layer_name:\"Some text\"; layer_nsome text\"; src:\"192.168.81.62\"]" ]
| extract pairdelim="; ]" kvdelim=":"
| table _raw action origin dst src&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 21:17:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642919#M222673</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-05-10T21:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with extracting specific symbols/text from raw log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642921#M222675</link>
      <description>&lt;P&gt;I see I missed layer_name, which extract fails to pull, probably due to the whitespace.&amp;nbsp; Here's a combination of extract and rex to get the desired results...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=dummy
| append [| makeresults | eval _raw="some text - [action:\"Accept\"; some text ; origin:\"10.111.10.111\"; some text]; dst:\"192.168.11.01\"; some text684\"; layer_name:\"Some text\"; layer_nsome text\"; src:\"192.168.81.62\"]" ]
| extract pairdelim="; ]" kvdelim=":"
| rex "layer_name:\"(?&amp;lt;layer_name&amp;gt;[^\"]+)"
| table _raw action origin dst layer_name src&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 21:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642921#M222675</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-05-10T21:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with extracting specific symbols/text from raw log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642922#M222676</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250778"&gt;@enzomialich&lt;/a&gt;&amp;nbsp;thanks for the quick response. Yes, it all works. thank you very much!&lt;/P&gt;&lt;P&gt;I needed a single reg expression to extract the parts of the raw log as I want to discard all the rest&lt;/P&gt;&lt;P&gt;Kudos to you Sir!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 21:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642922#M222676</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-05-10T21:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with extracting specific symbols/text from raw log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642923#M222677</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;thank you very much for trying to help. Your solution for sure works, but I am not advanced to implement it.&lt;/P&gt;&lt;P&gt;Your help much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 21:29:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-extracting-specific-symbols-text-from-raw-log/m-p/642923#M222677</guid>
      <dc:creator>DanAlexander</dc:creator>
      <dc:date>2023-05-10T21:29:37Z</dc:date>
    </item>
  </channel>
</rss>

