<?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: Rex command to Show number values between two fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555239#M157606</link>
    <description>&lt;LI-CODE lang="markup"&gt;| rex "id\\\\\":\\\\\"(?&amp;lt;id&amp;gt;.*)\\\\\",\\\\\"language"&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 10 Jun 2021 07:36:04 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-06-10T07:36:04Z</dc:date>
    <item>
      <title>Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555237#M157604</link>
      <description>&lt;P&gt;How to use Rex command to show Value in between 'Id' and `language` for example&amp;nbsp;0827ce61-e07c-4b51-a052-681dcc94fa2f to show in table.&lt;BR /&gt;&lt;BR /&gt;I tried EREX to generate pattern, it worked in most cases but in some cases failed.&lt;BR /&gt;Is there any easy way to show the value between 2 fields?&lt;BR /&gt;&lt;BR /&gt;Provided the Event sample&lt;BR /&gt;&lt;BR /&gt;{"line":"c5fd03529388e8d6 INFO 2021-06-10 04:11:02,966 [reactor-http-epoll-2] com.test.content.test.external.SnsPayloadEventSender Sent payload event id=9a67e81d-5ae3-5e84-b1f7-b126c9f5c787 for payload event={\"approvalDate\":\"2015-06-10T04:11:02.128Z\",\"adenceIds\":[],\"adenceTargets\":[],\"collGroupId\":\"008be467-6c78-4079-94f0-70e2d6cc4003\",\"collections\":[\"d879aa85-698c-41a1-b066-a8ecdf6b8a9c\",\"d879aa85-698c-41a1-b066-a8ecdf6b8a9c\"],\"endSchedule\":\"3000-01-01T19:00:00.000Z\",\"id\":\"0827ce61-e07c-4b51-a052-681dcc94fa2f\",\"language\":\"ja\",\"mplace\":\"JP\",\"nodeVersion\":null,\"payloadType\":\"thread\",\"preview\":false,\"resourceSubType\":\"thread\",\"resourceType\":\"thread\",\"startSchedule\":\"2021-03-26T22:00:28.000Z\",\"type\":\"P\",\"version\":\"1622644250765\"}","source":"stdout","tag":"21c5897e605c","attrs":{"application":"test","team":"test"}}&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 07:16:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555237#M157604</guid>
      <dc:creator>rajasplunk89</dc:creator>
      <dc:date>2021-06-10T07:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555239#M157606</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "id\\\\\":\\\\\"(?&amp;lt;id&amp;gt;.*)\\\\\",\\\\\"language"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Jun 2021 07:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555239#M157606</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-10T07:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555241#M157607</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235271"&gt;@rajasplunk89&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;it depends on the presence of backslashes in your log.&lt;/P&gt;&lt;P&gt;If they are use this regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"id\\\":\\\"(?&amp;lt;id&amp;gt;[^\\]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/JNvX1g/1" target="_blank"&gt;https://regex101.com/r/JNvX1g/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if they aren't use this regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"id\":\"(?&amp;lt;id&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/0nuV10/1" target="_blank"&gt;https://regex101.com/r/0nuV10/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 07:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555241#M157607</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-06-10T07:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555246#M157609</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rajasplunk89_0-1623311518356.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14569iF6DC6D2EE4B42DD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rajasplunk89_0-1623311518356.png" alt="rajasplunk89_0-1623311518356.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;got the following error&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 07:52:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555246#M157609</guid>
      <dc:creator>rajasplunk89</dc:creator>
      <dc:date>2021-06-10T07:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555248#M157610</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235271"&gt;@rajasplunk89&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;regex is correct, as you can test in regex101, but sometimes in Splunk is required an additional backslash to escape the backslash in logs, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"id\\\\":\\\\"(?&amp;lt;id&amp;gt;[^\\]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 07:56:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555248#M157610</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-06-10T07:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555250#M157611</link>
      <description>&lt;P&gt;It worked in Most cases&lt;BR /&gt;But some cases it pulled entire event&lt;BR /&gt;&lt;BR /&gt;Is it Possible to filter even that?&lt;BR /&gt;What is the logic behind using ////&amp;nbsp;&lt;BR /&gt;could you please explain that too?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rajasplunk89_0-1623311847836.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14571iC63D24F70007059F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rajasplunk89_0-1623311847836.png" alt="rajasplunk89_0-1623311847836.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 07:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555250#M157611</guid>
      <dc:creator>rajasplunk89</dc:creator>
      <dc:date>2021-06-10T07:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555251#M157612</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235271"&gt;@rajasplunk89&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;could you share the full event that is wrong?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:04:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555251#M157612</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-06-10T08:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555252#M157613</link>
      <description>&lt;P&gt;In the case you have highlighted, the language element does not appear immediately after the id element, so the extract gives what is between id and language (which is what you asked for). If you just want what is between the double quotes after the id tag try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "id\\\\\":\\\\\"(?&amp;lt;id&amp;gt;[^\\\]*)"&lt;/LI-CODE&gt;&lt;P&gt;The backslashes are to escape the backslashes and the double quotes&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:04:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555252#M157613</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-10T08:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555260#M157614</link>
      <description>&lt;P&gt;Some values are wrong If I use&lt;BR /&gt;&lt;BR /&gt;rex "id\\\\\":\\\\\"(?&amp;lt;id&amp;gt;[^\\\]*)"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For example&amp;nbsp;52049d5f-23b4-4226-805d-4a210879b0aa is not Pulled whereas&amp;nbsp;4282b6b8-56dd-406d-8fbc-165b82a3f4d2 is getting Pulled&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rajasplunk89_0-1623313545698.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14573i1CF30EBE205A6054/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rajasplunk89_0-1623313545698.png" alt="rajasplunk89_0-1623313545698.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;{"line":"d4a1bdc6f233db7d INFO 2021-06-09 19:35:45,010 [reactor-http-epoll-4] com.test.content.test.external.SnsPayloadEventSender Sent payload event id=daae6ff7-bf8f-5b42-9975-36cca5dfd502 for payload event={\"approvalDate\":\"2021-06-09T19:35:44.670Z\",\"audienceIds\":[\"4282b6b8-56dd-406d-8fbc-165b82a3f4d2\"],\"audienceTargets\":[{\"id\":\"4282b6b8-56dd-406d-8fbc-165b82a3f4d2\",\"type\":null}],\"collectionGroupId\":\"82a74ac1-c527-4470-b7b0-fb5f3ef3c2e2\",\"collections\":[\"90eef6b9-8a55-43cd-9aa8-73d29a55494b\"],\"endSchedule\":\"3000-01-01T19:00:00.000Z\",\"id\":\"52049d5f-23b4-4226-805d-4a210879b0aa\",\"language\":\"es-419\",\"mplace\":\"US\",\"nodeVersion\":null,\"payloadType\":\"thread\",\"preview\":false,\"resourceSubType\":\"thread\",\"resourceType\":\"thread\",\"startSchedule\":\"2021-06-11T21:00:57.000Z\",\"type\":\"PUBLISH\",\"version\":\"1623267340386\"}","source":"stdout","tag":"4d9520571148","attrs":{"application":"test","team":"test"}}&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555260#M157614</guid>
      <dc:creator>rajasplunk89</dc:creator>
      <dc:date>2021-06-10T08:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555261#M157615</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "\"id\\\\\":\\\\\"(?&amp;lt;id&amp;gt;[^\\\]*)"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555261#M157615</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-10T08:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555263#M157616</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235271"&gt;@rajasplunk89&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex max_match=1 "\"id\\\":\\\"(?&amp;lt;id&amp;gt;[^\\]+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555263#M157616</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-06-10T08:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555265#M157617</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rajasplunk89_0-1623314107131.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14574i1A854B2F470D0BE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rajasplunk89_0-1623314107131.png" alt="rajasplunk89_0-1623314107131.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Still getting the wrong value&lt;BR /&gt;&lt;BR /&gt;{"line":"d4a1bdc6f233db7d INFO 2021-06-09 19:35:45,010 [reactor-http-epoll-4] com.test.content.test.external.SnsPayloadEventSender Sent payload event id=daae6ff7-bf8f-5b42-9975-36cca5dfd502 for payload event={\"approvalDate\":\"2021-06-09T19:35:44.670Z\",\"audienceIds\":[\"4282b6b8-56dd-406d-8fbc-165b82a3f4d2\"],\"audienceTargets\":[{\"id\":\"4282b6b8-56dd-406d-8fbc-165b82a3f4d2\",\"type\":null}],\"collectionGroupId\":\"82a74ac1-c527-4470-b7b0-fb5f3ef3c2e2\",\"collections\":[\"90eef6b9-8a55-43cd-9aa8-73d29a55494b\"],\"endSchedule\":\"3000-01-01T19:00:00.000Z\",\"id\":\"52049d5f-23b4-4226-805d-4a210879b0aa\",\"language\":\"es-419\",\"mplace\":\"US\",\"nodeVersion\":null,\"payloadType\":\"thread\",\"preview\":false,\"resourceSubType\":\"thread\",\"resourceType\":\"thread\",\"startSchedule\":\"2021-06-11T21:00:57.000Z\",\"type\":\"PUBLISH\",\"version\":\"1623267340386\"}","source":"stdout","tag":"4d9520571148","attrs":{"application":"test","team":"test"}}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:35:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555265#M157617</guid>
      <dc:creator>rajasplunk89</dc:creator>
      <dc:date>2021-06-10T08:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555266#M157618</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "\"id\\\\\":\\\\\"(?&amp;lt;id&amp;gt;[^\\\]*)\\\\\",\\\\\"language"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555266#M157618</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-10T08:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555268#M157619</link>
      <description>&lt;P&gt;Got this error&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rajasplunk89_0-1623314668174.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14575i5E5D55C1B6801ECC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rajasplunk89_0-1623314668174.png" alt="rajasplunk89_0-1623314668174.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:44:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555268#M157619</guid>
      <dc:creator>rajasplunk89</dc:creator>
      <dc:date>2021-06-10T08:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555269#M157620</link>
      <description>&lt;P&gt;Thanks a lot It worked&lt;BR /&gt;Could you please explain the Logic&lt;BR /&gt;Why so many Back slashes used ? Which backslash avoids which one&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:48:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555269#M157620</guid>
      <dc:creator>rajasplunk89</dc:creator>
      <dc:date>2021-06-10T08:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command to Show number values between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555271#M157622</link>
      <description>&lt;P&gt;rex takes a double-quoted string, this means if it contains a double quote, this needs to be escaped so it doesn't close the string. The escaping character is a backslash. This also means that backslashes have to be escaped with another backslash. The string you are searching also has escaped double quotes, so the match string needs to escape the escape and escape the double quote. That would get you to the point where the match string would work in regex101.com. However, is appears that the way splunk parses the spl, it requires a further 2 backslashes for each escaped original backslash. So, you can see that the backslashes keep piling up.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 09:00:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-to-Show-number-values-between-two-fields/m-p/555271#M157622</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-10T09:00:12Z</dc:date>
    </item>
  </channel>
</rss>

