<?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 With regex, can you help me with a matching issue for a blank space? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378102#M110847</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am having an issue with some regex that I wrote.&lt;/P&gt;

&lt;P&gt;it is working fine except for this blank space.&lt;/P&gt;

&lt;P&gt;Regex :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHA:\s(?P&amp;lt;value&amp;gt;[^\,\"]+)\,\sFile:(?P&amp;lt;file&amp;gt;\s*[^\,\"]+)Time:\s(\d+\.?\d*)\s(?:.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Log :&lt;/P&gt;

&lt;P&gt;Case 1:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;SHA: 829d93a28c73a03e832201de5159994, File: Time: 1537775701 details[File Analysis ]&lt;/CODE&gt; ------&amp;gt; not working when File name is blank space.&lt;/P&gt;

&lt;P&gt;Case 2:&lt;BR /&gt;
&lt;CODE&gt;SHA: 68a4b235449a8c3cfc8ed, File: Guia-Deshaon-quicaTime: 1537780892 details[File Analysis  ]&lt;/CODE&gt; -----&amp;gt; working fine.&lt;/P&gt;

&lt;P&gt;issue:&lt;/P&gt;

&lt;P&gt;Field extraction is not happening for filename in case 1. It is ignoring value for filename,&lt;BR /&gt;
but in the case 2 field extraction, it is happening.&lt;/P&gt;

&lt;P&gt;Please help. I am new to regex.&lt;/P&gt;</description>
    <pubDate>Sun, 10 Feb 2019 15:04:59 GMT</pubDate>
    <dc:creator>su_kumar</dc:creator>
    <dc:date>2019-02-10T15:04:59Z</dc:date>
    <item>
      <title>With regex, can you help me with a matching issue for a blank space?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378102#M110847</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am having an issue with some regex that I wrote.&lt;/P&gt;

&lt;P&gt;it is working fine except for this blank space.&lt;/P&gt;

&lt;P&gt;Regex :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHA:\s(?P&amp;lt;value&amp;gt;[^\,\"]+)\,\sFile:(?P&amp;lt;file&amp;gt;\s*[^\,\"]+)Time:\s(\d+\.?\d*)\s(?:.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Log :&lt;/P&gt;

&lt;P&gt;Case 1:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;SHA: 829d93a28c73a03e832201de5159994, File: Time: 1537775701 details[File Analysis ]&lt;/CODE&gt; ------&amp;gt; not working when File name is blank space.&lt;/P&gt;

&lt;P&gt;Case 2:&lt;BR /&gt;
&lt;CODE&gt;SHA: 68a4b235449a8c3cfc8ed, File: Guia-Deshaon-quicaTime: 1537780892 details[File Analysis  ]&lt;/CODE&gt; -----&amp;gt; working fine.&lt;/P&gt;

&lt;P&gt;issue:&lt;/P&gt;

&lt;P&gt;Field extraction is not happening for filename in case 1. It is ignoring value for filename,&lt;BR /&gt;
but in the case 2 field extraction, it is happening.&lt;/P&gt;

&lt;P&gt;Please help. I am new to regex.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 15:04:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378102#M110847</guid>
      <dc:creator>su_kumar</dc:creator>
      <dc:date>2019-02-10T15:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: With regex, can you help me with a matching issue for a blank space?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378103#M110848</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Try this

SHA:\s(?&amp;lt;SHA&amp;gt;[^\,\"]+)\,\sFile:\s(?&amp;lt;File&amp;gt;.*?)Time:\s(?&amp;lt;Time&amp;gt;\d+)\s.+
| table SHA File Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Feb 2019 15:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378103#M110848</guid>
      <dc:creator>saurabhkharkar</dc:creator>
      <dc:date>2019-02-10T15:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: With regex, can you help me with a matching issue for a blank space?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378104#M110849</link>
      <description>&lt;P&gt;it is working on Regex101.com but still field extraction is not happening for file  when after File: has space then Time:&lt;BR /&gt;
  log : File:  Time:506034567 ---&amp;gt; here After File: has one space then Time: field&lt;BR /&gt;
Why  this field extraction is not happening when File: has space value&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 18:46:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378104#M110849</guid>
      <dc:creator>su_kumar</dc:creator>
      <dc:date>2019-02-10T18:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: With regex, can you help me with a matching issue for a blank space?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378105#M110850</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;seems to be working fine for me 
run this search - string is your sample log

| makeresults
| eval string="SHA: 829d93a28c73a03e832201de5159994, File: Time: 1537775701 details[File Analysis ]"
|rex field=string "SHA:\s(?&amp;lt;SHA&amp;gt;[^\,\"]+)\,\sFile:\s(?&amp;lt;File&amp;gt;.*?)Time:\s(?&amp;lt;Time&amp;gt;\d+)\s.+"
 | table SHA File Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Feb 2019 19:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378105#M110850</guid>
      <dc:creator>saurabhkharkar</dc:creator>
      <dc:date>2019-02-10T19:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: With regex, can you help me with a matching issue for a blank space?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378106#M110851</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "SHA:\s(?&amp;lt;SHA&amp;gt;[^,]+),\sFile:\s(?&amp;lt;File&amp;gt;\S*?)Time:\s(?&amp;lt;Time&amp;gt;\d+)\sdetails\s*\[(?&amp;lt;details&amp;gt;[^\]]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Feb 2019 07:05:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378106#M110851</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-11T07:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: With regex, can you help me with a matching issue for a blank space?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378107#M110852</link>
      <description>&lt;P&gt;You can try this, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | rex  "SHA\:\s([a-zA-Z0-9]+)\,\sFile\:(?P&amp;lt;File&amp;gt;[^Time].*)Time\:(?P&amp;lt;Time&amp;gt;[^\d]\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;run anywhere this search,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="SHA: 829d93a28c73a03e832201de5159994, File: Time: 1537775701 details[File Analysis ];
SHA: 68a4b235449a8c3cfc8ed, File: Guia-Deshaon-quicaTime: 1537780892 details[File Analysis ] " 
| makemv delim=";" data 
| mvexpand data 
| rename data as _raw 
| fields - _time 
| rex field=_raw "SHA\:\s([a-zA-Z0-9]+)\,\sFile\:(?P&amp;lt;File&amp;gt;[^Time].*)Time\:(?P&amp;lt;Time&amp;gt;[^\d]\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Feb 2019 07:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378107#M110852</guid>
      <dc:creator>vinod94</dc:creator>
      <dc:date>2019-02-11T07:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: With regex, can you help me with a matching issue for a blank space?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378108#M110853</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval msg="SHA: 829d93a28c73a03e832201de5159994, File: Time: 1537775701 details[File Analysis ] ; SHA: 68a4b235449a8c3cfc8ed, File: Guia-Deshaon-quicaTime: 1537780892 details[File Analysis ]"
| makemv delim=";" msg
| mvexpand msg
| rex field=msg "SHA:\s(?P&amp;lt;value&amp;gt;[^\,\"]+)\,\sFile:(?P&amp;lt;file&amp;gt;\s*[^\,\"]+)?Time:\s(\d+\.?\d*)\s(?:.*)"
| eval file = if('file'=" ","Null",'file')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you two file values Null and Guia-Deshaon-quica&lt;/P&gt;</description>
      <pubDate>Sun, 17 Feb 2019 14:04:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378108#M110853</guid>
      <dc:creator>kushagra9120</dc:creator>
      <dc:date>2019-02-17T14:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: With regex, can you help me with a matching issue for a blank space?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378109#M110854</link>
      <description>&lt;P&gt;Hey, where did you go?  Come back here and tell us what happened.  Click &lt;CODE&gt;Accept&lt;/CODE&gt; somewhere and close the question.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 03:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/With-regex-can-you-help-me-with-a-matching-issue-for-a-blank/m-p/378109#M110854</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-08T03:21:02Z</dc:date>
    </item>
  </channel>
</rss>

