<?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: How do you create a regex expression which creates a field and returns text after a backslash? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432208#M123495</link>
    <description>&lt;P&gt;@synking, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex "SERVERNAME\s\\\s(?&amp;lt;username&amp;gt;[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Oct 2018 13:25:33 GMT</pubDate>
    <dc:creator>493669</dc:creator>
    <dc:date>2018-10-22T13:25:33Z</dc:date>
    <item>
      <title>How do you create a regex expression which creates a field and returns text after a backslash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432207#M123494</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;i need assistance in trying to figure out how to create a field and extract the text after that.  I am not sure how to go about doing this.  i have looked in the documentation and on here for questions that are similar, but nothing i try seems to work.  Basically, in the logs I am searching, there is a string: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SERVERNAME\USERNAME
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to create a field called username from the above entry.  There is always a space after and before those two words and always the backslash.  Here is what i have so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "SERVERNAME\\:\s+(?&amp;lt;USERNAME&amp;gt;[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But, I am not sure what i am doing wrong.  Any help is gladly accepted. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 13:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432207#M123494</guid>
      <dc:creator>synking</dc:creator>
      <dc:date>2018-10-22T13:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create a regex expression which creates a field and returns text after a backslash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432208#M123495</link>
      <description>&lt;P&gt;@synking, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex "SERVERNAME\s\\\s(?&amp;lt;username&amp;gt;[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Oct 2018 13:25:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432208#M123495</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-10-22T13:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create a regex expression which creates a field and returns text after a backslash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432209#M123496</link>
      <description>&lt;P&gt;Thanks but even when i try that it does not seem to work.  I get the search to complete but it shows everything in every log.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 13:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432209#M123496</guid>
      <dc:creator>synking</dc:creator>
      <dc:date>2018-10-22T13:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create a regex expression which creates a field and returns text after a backslash?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432210#M123497</link>
      <description>&lt;P&gt;Wait nvm it worked I was just putting it in the wrong field.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 13:46:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-a-regex-expression-which-creates-a-field-and/m-p/432210#M123497</guid>
      <dc:creator>synking</dc:creator>
      <dc:date>2018-10-22T13:46:26Z</dc:date>
    </item>
  </channel>
</rss>

