<?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 regular express to stop at &amp;quot;=&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309825#M92945</link>
    <description>&lt;P&gt;Hi, I have a search string that does the following:&lt;/P&gt;

&lt;P&gt;temperature sourcetype=kaa | rex field=_raw "\"endpointKeyHash\":{\"string\":\"(?[^\"]&lt;EM&gt;)\".&lt;/EM&gt;\"Event\": (?{.*})$" | spath input=mydata | table _time, temperature, endpoint&lt;/P&gt;

&lt;P&gt;The results will have 3 columns as _time, endpoint, temperature. &lt;BR /&gt;
Under endpoint, it will reflect something like MASHjkasdhfa=. &lt;/P&gt;

&lt;P&gt;I wanted to extract just MASHjkasdhfa but I can't do it with (?[^=]*)? How should I phrase it?&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2017 07:26:21 GMT</pubDate>
    <dc:creator>wuming79</dc:creator>
    <dc:date>2017-05-24T07:26:21Z</dc:date>
    <item>
      <title>regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309825#M92945</link>
      <description>&lt;P&gt;Hi, I have a search string that does the following:&lt;/P&gt;

&lt;P&gt;temperature sourcetype=kaa | rex field=_raw "\"endpointKeyHash\":{\"string\":\"(?[^\"]&lt;EM&gt;)\".&lt;/EM&gt;\"Event\": (?{.*})$" | spath input=mydata | table _time, temperature, endpoint&lt;/P&gt;

&lt;P&gt;The results will have 3 columns as _time, endpoint, temperature. &lt;BR /&gt;
Under endpoint, it will reflect something like MASHjkasdhfa=. &lt;/P&gt;

&lt;P&gt;I wanted to extract just MASHjkasdhfa but I can't do it with (?[^=]*)? How should I phrase it?&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 07:26:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309825#M92945</guid>
      <dc:creator>wuming79</dc:creator>
      <dc:date>2017-05-24T07:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309826#M92946</link>
      <description>&lt;P&gt;Use following rex to extract text before "=" symbol &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=endpoint "(?&amp;lt;extracted_endpoint&amp;gt;.+?)="
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try using &lt;A href="https://regex101.com/"&gt;regex101&lt;/A&gt; for generating rex in future&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 08:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309826#M92946</guid>
      <dc:creator>harshal_chakran</dc:creator>
      <dc:date>2017-05-24T08:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309827#M92947</link>
      <description>&lt;P&gt;Hi wuming79,&lt;BR /&gt;
sorry, could you share an example of your logs?&lt;BR /&gt;
in addition could you format as Code Sample you regex, because isn't readable.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 08:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309827#M92947</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-05-24T08:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309828#M92948</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;The log is in this format under _raw field. Sorry, how do I paste it as Code Sample?&lt;/P&gt;

&lt;P&gt;2641328 [EPS-log-dispatcher-11] INFO  1.24978294676695149906 - {"Log Header": "{"endpointKeyHash":{"string":"MAz7MadOhr02tPt5vtZsSEy9FWw="},"applicationToken":{"string":"24978294676695149906"},"headerVersion":{"int":1},"timestamp":{"long":1495594584490},"logSchemaVersion":{"int":2}}","Event":{"temperature":-1,"timeStamp":1495594583638}}&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 09:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309828#M92948</guid>
      <dc:creator>wuming79</dc:creator>
      <dc:date>2017-05-24T09:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309829#M92949</link>
      <description>&lt;P&gt;Not sure why my original question was not updated. I need to correct my search string which is &lt;/P&gt;

&lt;P&gt;temperature sourcetype=kaa_file | rex field=_raw "\"endpointKeyHash\":{\"string\":\"(?[^\"]&lt;EM&gt;)\".&lt;/EM&gt;\"Event\": (?{.*})$" | spath input=mydata | table _time, temperature, endpoint&lt;/P&gt;

&lt;P&gt;I tried replacing "(?[^\"]*) with "(?.+?)=" and it works. But what does .+?)= means? I thought everything that I wanted to extract should be within the ( )?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:11:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309829#M92949</guid>
      <dc:creator>wuming79</dc:creator>
      <dc:date>2020-09-29T14:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309830#M92950</link>
      <description>&lt;P&gt;Hi wuming79,&lt;BR /&gt;
if I correctly understand: you want to extract the string between double quotes after endpointKeyHash and String, correct?&lt;/P&gt;

&lt;P&gt;if this is your need, your regex is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;endpointKeyHash\":\{\"string\":\"(?&amp;lt;endpointKeyHash&amp;gt;[^\=\"]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can test it at &lt;A href="https://regex101.com/r/rbE3YH/1"&gt;https://regex101.com/r/rbE3YH/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;When you insert a regex in a message, you have to select it and click on the "Code Sample" button (the one with 101010 numbers): in this way it's possible to see special characters.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 10:05:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309830#M92950</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-05-24T10:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309831#M92951</link>
      <description>&lt;P&gt;Go to regex101.com and enter your string and the regex. It will tell you exactly what each of the different symbols are doing on the right hand side of the extraction.  Cheers. &lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 13:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309831#M92951</guid>
      <dc:creator>damiensurat</dc:creator>
      <dc:date>2017-05-24T13:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309832#M92952</link>
      <description>&lt;P&gt;You are probably using &lt;CODE&gt;.*&lt;/CODE&gt; to capture the field, switch this to &lt;CODE&gt;[^=]*&lt;/CODE&gt; instead.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 14:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309832#M92952</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-24T14:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: regular express to stop at "="</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309833#M92953</link>
      <description>&lt;P&gt;Thanks Giuseppe. I got it now.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 03:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regular-express-to-stop-at-quot-quot/m-p/309833#M92953</guid>
      <dc:creator>wuming79</dc:creator>
      <dc:date>2017-05-26T03:26:58Z</dc:date>
    </item>
  </channel>
</rss>

