<?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: Help with Rex field-extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124773#M33741</link>
    <description>&lt;P&gt;Thank you! This works for me! I was using &lt;A href="http://www.regexr.com"&gt;www.regexr.com&lt;/A&gt; and plugged your solution in there and doesn't seem to work, but I'll definitely try out regex101.com.&lt;/P&gt;</description>
    <pubDate>Thu, 28 May 2015 15:07:11 GMT</pubDate>
    <dc:creator>d00680245</dc:creator>
    <dc:date>2015-05-28T15:07:11Z</dc:date>
    <item>
      <title>Help with Rex field-extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124771#M33739</link>
      <description>&lt;P&gt;I'm having a difficult time extracting the value for reportId. I'm not sure how to find the digits to the right of "reportId":&lt;BR /&gt;The reportId value has a range between 5 to 9 digits. I basically want to find anything between "reportId": AND ,&lt;BR /&gt;I've tried Splunk Field-Extractor and many similar examples on answers, but just cannot seem to get anything working.&lt;/P&gt;&lt;P&gt;raw sample data:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;2015-05-28 08:27:19,378 INFO com.test.test.reports.Generation.ReportImageServiceListener - message received: {"location":"1","area":1,"Symbol":" LT","Number":"12345","Ids":[1.0,2.0,6.0],"Category":"ALL","reportLevel":"FIELD_GROUP","reportDelivery":"EMAIL_BUNDLE","reportType":"FORM","reportLayout":"LANDSCAPE","Year":2015,"userId":50000,"reportId":0000001,"layers":["CLU_BOUNDARIES","TEST_CLU_BOUNDARIES","ASSOCIATED_LABELS","CLU_LABELS","ASSOCIATED_CLUS","ANNUAL_CLUS","TEST_ACRES_CLUS","POLYGONS","AERIAL_IMAGERY","COUNTIES","PLSS","ROADS","TOWNS","WATERWAYS"],"plantedReport":false,"CluLabelOne":"FSN","FieldLabelFour":"NONE","FieldDisplayOption":"ALL","CluLabelThree":"FIELD","CluLabelTwo":"TRACT","FieldLabelOne":"LABEL","FieldLabelTwo":"ACRES","CluLabelFour":"FIELD_ACRES","FieldColorOption":"CROP","CluLabelFive":"PLANTED_ACRES","FieldLabelThree":"NONE","FieldYieldOption":"CURRENT_USE","FieldLabelFive":"NONE"}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 13:54:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124771#M33739</guid>
      <dc:creator>d00680245</dc:creator>
      <dc:date>2022-04-28T13:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Rex field-extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124772#M33740</link>
      <description>&lt;P&gt;This regex string works well according to regex101.com.  Depending on whether you're extracting at index time or search time, you'll want to put it into a REGEX statement or a rex command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;reportId\":(?P&amp;lt;reportID&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 May 2015 14:23:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124772#M33740</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-28T14:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Rex field-extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124773#M33741</link>
      <description>&lt;P&gt;Thank you! This works for me! I was using &lt;A href="http://www.regexr.com"&gt;www.regexr.com&lt;/A&gt; and plugged your solution in there and doesn't seem to work, but I'll definitely try out regex101.com.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 15:07:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124773#M33741</guid>
      <dc:creator>d00680245</dc:creator>
      <dc:date>2015-05-28T15:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Rex field-extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124774#M33742</link>
      <description>&lt;P&gt;The biggest advantage (IMO) that regex101 has over regexr is support for the same regex syntax as Splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 15:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124774#M33742</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-28T15:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Rex field-extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124775#M33743</link>
      <description>&lt;P&gt;regexr.com was my first love... and then I discovered that regex101.com understands the named capturing groups where the former does not. it's also nice to be able to save and share your regex with a link.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 16:11:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124775#M33743</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-05-28T16:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Rex field-extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124776#M33744</link>
      <description>&lt;P&gt;You might consider making a bit more of a generic regex so you can use it with other fields.   If you just tell splunk "after this stuff, grab anything thats inside the quotes.. or grab anything before this comma" you might use that regex on other fields too!   Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex "reportId\"\:(?&amp;lt;reportId&amp;gt;[^,\"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Inside that regex, I'm looking for a single character list, but the ^ "caret" negates it, so it says "anything that is not a comma, or a quote".. and then we repeat that as many times as we can with the "+" plus sign.  Make a slight change to the preceding characters and the field name and use the same internal regex, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "reportLayout\"\:\"(?&amp;lt;reportLayout&amp;gt;[^,\"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 May 2015 01:10:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Rex-field-extraction/m-p/124776#M33744</guid>
      <dc:creator>Michael_Wilde</dc:creator>
      <dc:date>2015-05-29T01:10:49Z</dc:date>
    </item>
  </channel>
</rss>

