<?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 Linux permissions using rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519337#M146252</link>
    <description>&lt;P&gt;Thank you, this is great. However, it does not match for commands like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;find / -perm -o+w
find . \( -perm -o rwx \) -type d 2&amp;gt;/dev/null&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Is it possible for the same regex expression to have this?&lt;/P&gt;</description>
    <pubDate>Mon, 14 Sep 2020 05:45:42 GMT</pubDate>
    <dc:creator>izyknows</dc:creator>
    <dc:date>2020-09-14T05:45:42Z</dc:date>
    <item>
      <title>Extracting Linux permissions using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519307#M146235</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;I'm looking to extract certain values from a Linux command line. Take the following example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval sampleCLI="find / -perm -664 -type d 2&amp;gt;/dev/null"
| eval sampleCLI2="find . -perm -2 -type d 2&amp;gt;/dev/null"
| eval sampleCLI3="find . \( -perm -o rwx \) -type d 2&amp;gt;/dev/null"
| eval sampleCLI4="find / -perm -o+w"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is to extract the permissions and run some checks on it. For example, 664, 2, rwx and +w respectively in the above example. I'm having a hard type writing the regex query for this. I'm new to this and was trying to keep it simple and just get the value using negative matching like so&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=sampleCLI* “find * -perm (?&amp;lt;permval&amp;gt;\S+)” &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However the rex command doesn't even run. Throws up the following error: Error in 'rex' command: The regex '“find' does not extract anything. It should specify at least one named group. Format: (?&amp;lt;name&amp;gt;...).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please explain where I'm going wrong? Thanks very much!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 15:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519307#M146235</guid>
      <dc:creator>izyknows</dc:creator>
      <dc:date>2020-09-13T15:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Linux permissions using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519310#M146238</link>
      <description>&lt;P&gt;you can't use wildcard (*) in rex field attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=sampleCLI "-perm\s+-(-0)?(?&amp;lt;permission&amp;gt;[^\s]+)"
| rex field=sampleCLI2 "-perm\s+-(-0)?(?&amp;lt;permission&amp;gt;[^\s]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 15:44:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519310#M146238</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-13T15:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Linux permissions using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519337#M146252</link>
      <description>&lt;P&gt;Thank you, this is great. However, it does not match for commands like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;find / -perm -o+w
find . \( -perm -o rwx \) -type d 2&amp;gt;/dev/null&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Is it possible for the same regex expression to have this?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 05:45:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519337#M146252</guid>
      <dc:creator>izyknows</dc:creator>
      <dc:date>2020-09-14T05:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Linux permissions using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519350#M146262</link>
      <description>&lt;P&gt;| rex field=yourfield "-perm(\s-o)?\s?(-|\+)?(?&amp;lt;permission&amp;gt;[^\s]+)"&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 07:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-Linux-permissions-using-rex/m-p/519350#M146262</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-14T07:29:59Z</dc:date>
    </item>
  </channel>
</rss>

