<?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 How to create a search for the fields using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-the-fields-using-regex/m-p/430560#M123096</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have the following string pattern (source):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/trace/DB_BWP/xsengine_ls5925.30246.crashdump.20190312-213001.009072.trc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I need to create at search following fields:&lt;BR /&gt;
- DBSID, being "BWP" in this case&lt;BR /&gt;
- servis, being the "xsengine"&lt;BR /&gt;
- filename, being "xsengine_ls5925.30246.crashdump.20190312-213001.009072.trc"&lt;/P&gt;

&lt;P&gt;For the filename I managed to find the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=source "(?&amp;lt;filename&amp;gt;[\w\d\.-]+$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But somehow I struggle with the first two ...&lt;/P&gt;

&lt;P&gt;Kind Regards,&lt;BR /&gt;
Kamil&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2019 11:09:28 GMT</pubDate>
    <dc:creator>damucka</dc:creator>
    <dc:date>2019-03-13T11:09:28Z</dc:date>
    <item>
      <title>How to create a search for the fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-the-fields-using-regex/m-p/430560#M123096</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have the following string pattern (source):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/trace/DB_BWP/xsengine_ls5925.30246.crashdump.20190312-213001.009072.trc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I need to create at search following fields:&lt;BR /&gt;
- DBSID, being "BWP" in this case&lt;BR /&gt;
- servis, being the "xsengine"&lt;BR /&gt;
- filename, being "xsengine_ls5925.30246.crashdump.20190312-213001.009072.trc"&lt;/P&gt;

&lt;P&gt;For the filename I managed to find the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=source "(?&amp;lt;filename&amp;gt;[\w\d\.-]+$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But somehow I struggle with the first two ...&lt;/P&gt;

&lt;P&gt;Kind Regards,&lt;BR /&gt;
Kamil&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 11:09:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-the-fields-using-regex/m-p/430560#M123096</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2019-03-13T11:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search for the fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-the-fields-using-regex/m-p/430561#M123097</link>
      <description>&lt;P&gt;Hi @damucka&lt;/P&gt;

&lt;P&gt;Try like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval log="/trace/DB_BWP/xsengine_ls5925.30246.crashdump.20190312-213001.009072.trc" 
| rex field=log "\/.+_(?P&amp;lt;DBSID&amp;gt;.+)\/(?P&amp;lt;servis&amp;gt;.+)\_(?&amp;lt;filename&amp;gt;.+)$" 
| eval filename = servis."_".filename
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2019 11:19:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-the-fields-using-regex/m-p/430561#M123097</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-13T11:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search for the fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-the-fields-using-regex/m-p/430562#M123098</link>
      <description>&lt;P&gt;Hi @vnravikumar &lt;/P&gt;

&lt;P&gt;Thank you, it work fine.&lt;/P&gt;

&lt;P&gt;Kind regards,&lt;BR /&gt;
Kamil&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 08:47:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-the-fields-using-regex/m-p/430562#M123098</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2019-03-14T08:47:05Z</dc:date>
    </item>
  </channel>
</rss>

