<?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: Can you help me create the regex that captures a string with a space in it? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412338#M118904</link>
    <description>&lt;P&gt;If the event is on one line, you can use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "Model=(?P&amp;lt;Model&amp;gt;.*?)\sName"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 27 Nov 2018 09:32:23 GMT</pubDate>
    <dc:creator>MathiasLindblom</dc:creator>
    <dc:date>2018-11-27T09:32:23Z</dc:date>
    <item>
      <title>Can you help me create the regex that captures a string with a space in it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412332#M118898</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I have a field with a space in the string :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Model=WDC WD5000LPLX-60ZNTT1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But SPLUNK displays only the characters WDC because of the space.&lt;/P&gt;

&lt;P&gt;I need a regex please which displays WDC WD5000LPLX-60ZNTT1 (so with the space) but that will be readable by Splunk.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 06:20:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412332#M118898</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-27T06:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create the regex that captures a string with a space in it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412333#M118899</link>
      <description>&lt;P&gt;we need to see the entire event (preferably several of them).&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 06:28:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412333#M118899</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-11-27T06:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create the regex that captures a string with a space in it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412334#M118900</link>
      <description>&lt;P&gt;If we assume that whatever comes after Model= is fixed, eg:&lt;BR /&gt;&lt;BR /&gt;
Model=WDC WD5000LPLX-60ZNTT1 Test=XYZ  &lt;/P&gt;

&lt;P&gt;You could use a lookahead to "Test" like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    Model=(?P&amp;lt;Model&amp;gt;.*(?!Test))\s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this could help, otherwise it would help with the entire event as mentioned before.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 07:13:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412334#M118900</guid>
      <dc:creator>MathiasLindblom</dc:creator>
      <dc:date>2018-11-27T07:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create the regex that captures a string with a space in it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412335#M118901</link>
      <description>&lt;P&gt;I done &lt;CODE&gt;| rex field=Caption "(?P(?!Test))\s" but i have the message&lt;/CODE&gt;⚠    Error in 'rex' command: Encountered the following error while compiling the regex '(?P(?!Test))\s': Regex: unrecognized character after (?P &lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 08:44:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412335#M118901</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-27T08:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create the regex that captures a string with a space in it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412336#M118902</link>
      <description>&lt;P&gt;here is an example of one event fields&lt;BR /&gt;
    20181121161210.530611&lt;BR /&gt;
    Caption=WDC WD5000LPLX-60ZNTT1&lt;BR /&gt;
    DeviceID=\.\PHYSICALDRIVE0&lt;BR /&gt;
    FirmwareRevision=02.01A02&lt;BR /&gt;
    Model=WDC WD5000LPLX-60ZNTT1&lt;BR /&gt;
    Name=\.\PHYSICALDRIVE0&lt;BR /&gt;
    Size=500105249280&lt;BR /&gt;
    Status=OK&lt;BR /&gt;
    wmi_type=DiskDrive&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 08:46:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412336#M118902</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-27T08:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create the regex that captures a string with a space in it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412337#M118903</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;seems like I lost a few characters when posting. If the event are as you described above, where they are all on each line, this regex should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "Model=(?P&amp;lt;Model&amp;gt;[^\n]*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Nov 2018 09:25:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412337#M118903</guid>
      <dc:creator>MathiasLindblom</dc:creator>
      <dc:date>2018-11-27T09:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create the regex that captures a string with a space in it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412338#M118904</link>
      <description>&lt;P&gt;If the event is on one line, you can use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "Model=(?P&amp;lt;Model&amp;gt;.*?)\sName"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Nov 2018 09:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412338#M118904</guid>
      <dc:creator>MathiasLindblom</dc:creator>
      <dc:date>2018-11-27T09:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create the regex that captures a string with a space in it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412339#M118905</link>
      <description>&lt;P&gt;perfect thanks&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 09:42:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-the-regex-that-captures-a-string-with-a/m-p/412339#M118905</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-27T09:42:01Z</dc:date>
    </item>
  </channel>
</rss>

