<?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: regex help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551176#M156411</link>
    <description>&lt;LI-CODE lang="markup"&gt;\\(?&amp;lt;source&amp;gt;[\w\-]+)\-(?&amp;lt;issue&amp;gt;\w+)\.log$&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 11 May 2021 06:43:01 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-05-11T06:43:01Z</dc:date>
    <item>
      <title>regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551144#M156385</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need some help with the regex,&lt;/P&gt;&lt;P&gt;Currently we have below two paths, note the naming format is different for the log files&lt;/P&gt;&lt;P&gt;\\path\\to\\my\\app\\folder\userx-test-cpuissue.log&lt;BR /&gt;\\path\\to\\my\\app\\folder\usery-cpuissue.log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a regex to extract user and issue, but it is not able to pick userx since the log format is different i.e. userx-test-cpuissue.log. How do i wrote a single regex which could extract both the naming formats?&lt;/P&gt;&lt;P&gt;\\\\(?&amp;lt;source&amp;gt;\w+)-(?&amp;lt;issue&amp;gt;\w+)\.log$&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 23:08:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551144#M156385</guid>
      <dc:creator>SS1</dc:creator>
      <dc:date>2021-05-10T23:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551145#M156386</link>
      <description>&lt;LI-CODE lang="markup"&gt;\\(?&amp;lt;source&amp;gt;\w+)(\-\w+)?\-(?&amp;lt;issue&amp;gt;\w+)\.log$&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 10 May 2021 23:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551145#M156386</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-10T23:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551146#M156387</link>
      <description>&lt;P&gt;thanks for the response, although it is extracting just userx while i want it to extract userx-test. is that possible?&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 23:18:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551146#M156387</guid>
      <dc:creator>SS1</dc:creator>
      <dc:date>2021-05-10T23:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551148#M156389</link>
      <description>&lt;P&gt;You could try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=log "\\\\(?&amp;lt;user&amp;gt;\w+)-(?&amp;lt;issue&amp;gt;.*)\.log$"&lt;/LI-CODE&gt;&lt;P&gt;where your 'issue' field extraction takes _any_ character up to the .log after the user rather than \w.&lt;/P&gt;&lt;P&gt;Shown in this example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval log=split("\\\\path\\\\to\\\\my\\\\app\\\\folder\\userx-test-cpuissue.log,\\\\path\\\\to\\\\my\\\\app\\\\folder\\usery-cpuissue.log",",")
| mvexpand log
| rex field=log "\\\\(?&amp;lt;user&amp;gt;\w+)-(?&amp;lt;issue&amp;gt;.*)\.log$"&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 23:22:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551148#M156389</guid>
      <dc:creator>abowesman</dc:creator>
      <dc:date>2021-05-10T23:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551176#M156411</link>
      <description>&lt;LI-CODE lang="markup"&gt;\\(?&amp;lt;source&amp;gt;[\w\-]+)\-(?&amp;lt;issue&amp;gt;\w+)\.log$&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 May 2021 06:43:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/551176#M156411</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-11T06:43:01Z</dc:date>
    </item>
  </channel>
</rss>

