<?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: How do you use the rex command to obtain values to be put into a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324225#M96758</link>
    <description>&lt;P&gt;I usually use regexes in Splunk never in Javascripts, anyway try something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.*businessDate\=([^\\]*)\\u0026closeoutSchemeId\=([^\\]*)\\u0026.*positionStateId\=([^\"]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Group1 is businessDate&lt;/LI&gt;
&lt;LI&gt;Group2 is closeoutSchemeId&lt;/LI&gt;
&lt;LI&gt;Group3 is positionStateId&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;test it in &lt;A href="https://regex101.com/r/USbhRP/3"&gt;https://regex101.com/r/USbhRP/3&lt;/A&gt;&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2017 10:39:01 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-09-06T10:39:01Z</dc:date>
    <item>
      <title>How do you use the rex command to obtain values to be put into a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324219#M96752</link>
      <description>&lt;P&gt;I have a query :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=*perf* bf19f0c3-2f10-4db2-b33f-efb946b0ee24 {"StatusCode":204* | table Message
Out put  of the above query is as follows :
{"StatusCode":204,"ReasonPhrase":"No Content","Method":"GET","PathAndQuery":"/api/ibor/v2/positionValuations?businessDate=2017-09-04\u0026closeoutSchemeId=1\u0026expand=*\u0026logicalTimeId=150\u0026positionStateId=40","MessageType":"Response"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to take out the following value :&lt;BR /&gt;
1. businessDate&lt;BR /&gt;
2. positionStateId&lt;BR /&gt;
3. closeoutSchemeId&lt;/P&gt;

&lt;P&gt;and put them in a table in which the basic value should be businessDate=2017-09-04, positionStateId=40,closeoutSchemeId=1&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 06:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324219#M96752</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-09-06T06:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to obtain values to be put into a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324220#M96753</link>
      <description>&lt;P&gt;Output table should contain the values as follows :&lt;/P&gt;

&lt;P&gt;businessDate=&lt;STRONG&gt;2017-09-04&lt;/STRONG&gt;, &lt;BR /&gt;
positionStateId=&lt;STRONG&gt;40&lt;/STRONG&gt;,&lt;BR /&gt;
closeoutSchemeId=&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 07:01:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324220#M96753</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-09-06T07:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to obtain values to be put into a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324221#M96754</link>
      <description>&lt;P&gt;Hi JyotiP,&lt;BR /&gt;
use this regex with rex command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex ".*businessDate(?&amp;lt;businessDate&amp;gt;[^\\]*)\\u0026closeoutSchemeId\=(?&amp;lt;closeoutSchemeId&amp;gt;[^\\]*)\\u0026.*positionStateId\=(?&amp;lt;positionStateId&amp;gt;[^\"]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or extracting fields.&lt;/P&gt;

&lt;P&gt;Test it at &lt;A href="https://regex101.com/r/USbhRP/1"&gt;https://regex101.com/r/USbhRP/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 07:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324221#M96754</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-06T07:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to obtain values to be put into a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324222#M96755</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;

&lt;P&gt;It is not working because "\" is not supporting.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 10:04:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324222#M96755</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-09-06T10:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to obtain values to be put into a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324223#M96756</link>
      <description>&lt;P&gt;@cusello, &lt;BR /&gt;
tried but given the a pattern error please refer the following &lt;BR /&gt;
&lt;A href="https://regex101.com/r/USbhRP/1"&gt;https://regex101.com/r/USbhRP/1&lt;/A&gt; and please select javascript.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 10:07:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324223#M96756</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-09-06T10:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to obtain values to be put into a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324224#M96757</link>
      <description>&lt;P&gt;{"StatusCode":204,"ReasonPhrase":"No Content","Method":"GET","PathAndQuery":"/api/ibor/v2/positionValuations?businessDate=2017-09-04\u0026closeoutSchemeId=1\u0026expand=*\u0026logicalTimeId=150\u0026positionStateId=40","MessageType":"Response"}&lt;/P&gt;

&lt;P&gt;The highlighted value (\u0026expand=*\u0026logicalTimeId=150\u0026) are unique every time I hit it will change, and for different query the values are different but the &lt;BR /&gt;
businessDate=2017-09-04&lt;BR /&gt;
closeoutSchemeId=1&lt;BR /&gt;
positionStateId=40 &lt;BR /&gt;
will be as it is. So I want to capture only above 3 value irrespective of the values followed by the above values.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 10:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324224#M96757</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-09-06T10:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to obtain values to be put into a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324225#M96758</link>
      <description>&lt;P&gt;I usually use regexes in Splunk never in Javascripts, anyway try something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.*businessDate\=([^\\]*)\\u0026closeoutSchemeId\=([^\\]*)\\u0026.*positionStateId\=([^\"]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Group1 is businessDate&lt;/LI&gt;
&lt;LI&gt;Group2 is closeoutSchemeId&lt;/LI&gt;
&lt;LI&gt;Group3 is positionStateId&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;test it in &lt;A href="https://regex101.com/r/USbhRP/3"&gt;https://regex101.com/r/USbhRP/3&lt;/A&gt;&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 10:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324225#M96758</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-06T10:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to obtain values to be put into a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324226#M96759</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I know it's too late to answer but I would like to contribute the following idea:&lt;/P&gt;

&lt;P&gt;|rex  ".&lt;EM&gt;businessDate=(?\d.&lt;/EM&gt;-\d*)\.&lt;EM&gt;closeoutSchemeId=(?\d\u\d&lt;/EM&gt;).&lt;EM&gt;positionStateId=(?\d&lt;/EM&gt;)"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:46:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-obtain-values-to-be-put-into-a/m-p/324226#M96759</guid>
      <dc:creator>amy25</dc:creator>
      <dc:date>2020-09-29T21:46:18Z</dc:date>
    </item>
  </channel>
</rss>

