<?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: regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549631#M155972</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;so he is taking the first one, at the beginning I need him to take&amp;nbsp;REQ_IN&amp;nbsp;and so something doesn't work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval test="REQ_IN ...... { ...... \"productId\": \"test\", ...... { ....... \"productId\": \"test2\" }}"&lt;BR /&gt;| rex field=test "REQ_IN.*\"productId\":\s*\"(?&amp;lt;productId_rex&amp;gt;[^\"]+)\""&lt;/P&gt;&lt;P&gt;Simone&lt;/P&gt;</description>
    <pubDate>Wed, 28 Apr 2021 14:10:46 GMT</pubDate>
    <dc:creator>simo</dc:creator>
    <dc:date>2021-04-28T14:10:46Z</dc:date>
    <item>
      <title>regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549460#M155904</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a column containing&lt;BR /&gt;Request =&amp;nbsp;REQ_IN ...... { ...... "productId": "test", ...... { ....... "productId": "test2" }}&lt;BR /&gt;I have to take the containing value in the first one productId test&lt;BR /&gt;I using = | rex field=Request "REQ_IN.*\"productId\"(?&amp;lt;productId_rex&amp;gt;[^,]*)"&lt;BR /&gt;but it returns me the second value test2&lt;BR /&gt;how can i solve?&lt;/P&gt;&lt;P&gt;Simone&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 13:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549460#M155904</guid>
      <dc:creator>simo</dc:creator>
      <dc:date>2021-04-27T13:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549465#M155905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232048"&gt;@simo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try this regex?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^(?:[^:\n]*:){1}\"(?&amp;lt;productid&amp;gt;\w+)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Apr 2021 14:02:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549465#M155905</guid>
      <dc:creator>aasabatini</dc:creator>
      <dc:date>2021-04-27T14:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549470#M155906</link>
      <description>&lt;P&gt;it's not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 14:20:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549470#M155906</guid>
      <dc:creator>simo</dc:creator>
      <dc:date>2021-04-27T14:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549471#M155907</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232048"&gt;@simo&lt;/a&gt;&amp;nbsp; don't&amp;nbsp; worry&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^[^:\n]*:\"(?P&amp;lt;productId&amp;gt;\w+)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Apr 2021 14:26:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549471#M155907</guid>
      <dc:creator>aasabatini</dc:creator>
      <dc:date>2021-04-27T14:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549479#M155909</link>
      <description>&lt;P&gt;You need to use lazy expansion on the any character, something like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Request "REQ_IN.+?\"productId\":\s(?&amp;lt;productId_rex&amp;gt;[^,]*)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 14:56:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549479#M155909</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-27T14:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549486#M155910</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks so it goes, but it does not work if the value of productId is only once &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;simone&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 15:54:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549486#M155910</guid>
      <dc:creator>simo</dc:creator>
      <dc:date>2021-04-27T15:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549491#M155913</link>
      <description>&lt;P&gt;I was following your example, but perhaps you could also not extract the quotation marks and use that as the delimiter, rather than the comma, as I suspect that isn't present if there is only one?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Request "REQ_IN.+?\"productId\":\s\"(?&amp;lt;productId_rex&amp;gt;[^\"]*)"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Apr 2021 16:07:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549491#M155913</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-27T16:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549509#M155921</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232048"&gt;@simo&lt;/a&gt;,&lt;BR /&gt;Command rex captures the first match in the group. Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="Request = REQ_IN ...... { ...... \"productId\": \"test\", ...... { ....... \"productId\": \"test2\" }}" 
| rex field=test "\"productId\":\s*\"(?&amp;lt;productId_rex&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Apr 2021 18:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549509#M155921</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-04-27T18:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549631#M155972</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;so he is taking the first one, at the beginning I need him to take&amp;nbsp;REQ_IN&amp;nbsp;and so something doesn't work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval test="REQ_IN ...... { ...... \"productId\": \"test\", ...... { ....... \"productId\": \"test2\" }}"&lt;BR /&gt;| rex field=test "REQ_IN.*\"productId\":\s*\"(?&amp;lt;productId_rex&amp;gt;[^\"]+)\""&lt;/P&gt;&lt;P&gt;Simone&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 14:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549631#M155972</guid>
      <dc:creator>simo</dc:creator>
      <dc:date>2021-04-28T14:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549670#M155988</link>
      <description>&lt;P&gt;You need to use lazy quantifier (&lt;STRONG&gt;*?B&amp;nbsp;&lt;/STRONG&gt;instead of greedy (&lt;STRONG&gt;*&lt;/STRONG&gt;) to m&lt;SPAN&gt;atch as few characters as possible. Try this.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval test="REQ_IN ...... { ...... \"productId\": \"test\", ...... { ....... \"productId\": \"test2\" }}"
| rex field=test "REQ_IN.*?\"productId\":\s*\"(?&amp;lt;productId_rex&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, a like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 18:24:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549670#M155988</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-04-28T18:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549685#M155991</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;Looks very similar to my answer from yesterday &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 19:11:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549685#M155991</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-28T19:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549741#M156007</link>
      <description>&lt;P&gt;Yes, it is. My bad I was like lazy quantifier&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 05:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex/m-p/549741#M156007</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-04-29T05:43:35Z</dc:date>
    </item>
  </channel>
</rss>

