<?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: Why is &amp;quot;rex field&amp;quot; not producing results when used in an API call? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273403#M82419</link>
    <description>&lt;P&gt;That did it. Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2017 15:13:32 GMT</pubDate>
    <dc:creator>selsin</dc:creator>
    <dc:date>2017-06-14T15:13:32Z</dc:date>
    <item>
      <title>Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273395#M82411</link>
      <description>&lt;P&gt;Search works correctly in Splunk Web:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxxx | rex field=_raw "InvalidLogin\|NotFound\|(?&amp;lt;client&amp;gt;\w+)" | stats count by client
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But using it in an API call returns nothing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -u user:'password' -k &lt;A href="https://localhost:8089/services/search/jobs/export" target="test_blank"&gt;https://localhost:8089/services/search/jobs/export&lt;/A&gt; -d search='search index=xxxx | rex field=_raw "InvalidLogin\|NotFound\|(?&amp;lt;client&amp;gt;\w+)" | stats count by client' -d output_mode=csv -d earliest_time="-1d" -d latest_time="-1m"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can get other searches to execute correctly via API calls, and even other versions of this search that return multiple other fields. But if I ask it to return field "client" also, it always renders nothing for output.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 21:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273395#M82411</guid>
      <dc:creator>selsin</dc:creator>
      <dc:date>2017-02-01T21:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273396#M82412</link>
      <description>&lt;P&gt;Are there really asterisks in that regex around the word "client" in the two searches?  &lt;/P&gt;

&lt;P&gt;If asterisk-client-asterisk is a valid name, it needs to be used in the "by" clause as well as the rex.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 22:07:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273396#M82412</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-01T22:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273397#M82413</link>
      <description>&lt;P&gt;No, there are no asterisks. It is actually like this: (?&amp;lt;&lt;EM&gt;client&lt;/EM&gt;&amp;gt;\w+)&lt;BR /&gt;
When I was putting the question in, the preview window showed only (?\w+). So adding asterisks made it print in italics, but at least show correctly. Didn't know that once the question got approved and posted it would literally add the asterisks in.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 22:39:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273397#M82413</guid>
      <dc:creator>selsin</dc:creator>
      <dc:date>2017-02-01T22:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273398#M82414</link>
      <description>&lt;P&gt;Corrected the above queries. They now show correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 23:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273398#M82414</guid>
      <dc:creator>selsin</dc:creator>
      <dc:date>2017-02-01T23:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273399#M82415</link>
      <description>&lt;P&gt;Were you able to figure this out? I'm having the same issue. &lt;CODE&gt;rex&lt;/CODE&gt; doesn't seem to generate new fields when used in the API&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2017 13:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273399#M82415</guid>
      <dc:creator>scott_cultuream</dc:creator>
      <dc:date>2017-06-11T13:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273400#M82416</link>
      <description>&lt;P&gt;No was never able to get it to work. We ended up having to write a perl script to parse the output instead.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 14:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273400#M82416</guid>
      <dc:creator>selsin</dc:creator>
      <dc:date>2017-06-12T14:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273401#M82417</link>
      <description>&lt;P&gt;I actually was able to make it work. &lt;/P&gt;

&lt;P&gt;For some reason, the &lt;CODE&gt;rex&lt;/CODE&gt; expression that I was using in the UI didn't work. But when I rewrote to be based off of &lt;CODE&gt;_raw&lt;/CODE&gt; rather than another field, that did the trick. You have to write a more complex expression, but for me, it wasn't terrible.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 20:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273401#M82417</guid>
      <dc:creator>scott_cultuream</dc:creator>
      <dc:date>2017-06-12T20:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273402#M82418</link>
      <description>&lt;P&gt;Have you tried specifying your search with &lt;CODE&gt;--data-urlencode&lt;/CODE&gt; instead of &lt;CODE&gt;-d&lt;/CODE&gt; (which doensn't URL encode).  Your search contains a &lt;CODE&gt;+&lt;/CODE&gt;, which I believe represents a &lt;CODE&gt;space&lt;/CODE&gt; unless URL encoded.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 14:15:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273402#M82418</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-06-14T14:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why is "rex field" not producing results when used in an API call?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273403#M82419</link>
      <description>&lt;P&gt;That did it. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 15:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-quot-rex-field-quot-not-producing-results-when-used-in-an/m-p/273403#M82419</guid>
      <dc:creator>selsin</dc:creator>
      <dc:date>2017-06-14T15:13:32Z</dc:date>
    </item>
  </channel>
</rss>

