<?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 am I not getting value in a new created field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388300#M113226</link>
    <description>&lt;P&gt;@csharm21 &lt;/P&gt;

&lt;P&gt;Can you please make sure below points?&lt;/P&gt;

&lt;P&gt;1)  Check whether all field available... Mainly those which are in by clause.&lt;BR /&gt;
&lt;CODE&gt;index=throwaway sourcetype=GIC-EMR-Wrapper-log_V1 | table errorResponse.*&lt;/CODE&gt;&lt;BR /&gt;
2) Try with Enclosing filed name value with quotes. like &lt;CODE&gt;count(eval("errorResponse.ResponseCode"="CCEABR")) as "CCEABR Count"&lt;/CODE&gt; &amp;amp; &lt;BR /&gt;
from  &lt;CODE&gt;requestSpecificElements.clientID&lt;/CODE&gt; to &lt;CODE&gt;"requestSpecificElements.clientID"&lt;/CODE&gt; &lt;/P&gt;</description>
    <pubDate>Tue, 08 Jan 2019 07:36:59 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-01-08T07:36:59Z</dc:date>
    <item>
      <title>Why am I not getting value in a new created field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388299#M113225</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I am trying to create one SPL search and create a new field with the &lt;CODE&gt;eval&lt;/CODE&gt; command, but I am not getting any value count on the newly created field.&lt;/P&gt;

&lt;P&gt;Please find my query below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=throwaway sourcetype=GIC-EMR-Wrapper-log_V1
| stats 
count(eval(errorResponse.ResponseCode=CCEABR)) as "CCEABR Count"
count(eval(errorResponse.ResponseCode=CCEAIT)) as "CCEAIT Count"
count(eval(errorResponse.ResponseCode=CCEAEE)) as "CCEAEE Count" 
count(eval(errorResponse.ResponseCode=AESCND)) as "AESCND Count" 
count(eval(errorResponse.ResponseCode=AESCEE)) as "AESCEE Count" 
count(eval(errorResponse.ResponseCode=AERCEE)) as "AERCEE Count" 
count(eval(errorResponse.ResponseCode=CPDNA)) as "CPDNA Count"
count(eval(errorResponse.ResponseCode=CPMNF)) as "CPMNF Count"
count(eval(errorResponse.ResponseCode=CPLOB)) as "CPLOB Count"
count(eval(isnull(errorResponse.TimeStamp))) as "Timeout Count"
count(eval(errorResponse.JsonResponse="" or isnull(errorResponse.JsonResponse))) as "Success/No Error Code Count"
by requestSpecificElements.clientID requestSpecificElements.locationID
| rename requestSpecificElements.clientID as "Client ID"
requestSpecificElements.locationID as "Location ID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Jan 2019 07:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388299#M113225</guid>
      <dc:creator>csharm21</dc:creator>
      <dc:date>2019-01-08T07:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting value in a new created field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388300#M113226</link>
      <description>&lt;P&gt;@csharm21 &lt;/P&gt;

&lt;P&gt;Can you please make sure below points?&lt;/P&gt;

&lt;P&gt;1)  Check whether all field available... Mainly those which are in by clause.&lt;BR /&gt;
&lt;CODE&gt;index=throwaway sourcetype=GIC-EMR-Wrapper-log_V1 | table errorResponse.*&lt;/CODE&gt;&lt;BR /&gt;
2) Try with Enclosing filed name value with quotes. like &lt;CODE&gt;count(eval("errorResponse.ResponseCode"="CCEABR")) as "CCEABR Count"&lt;/CODE&gt; &amp;amp; &lt;BR /&gt;
from  &lt;CODE&gt;requestSpecificElements.clientID&lt;/CODE&gt; to &lt;CODE&gt;"requestSpecificElements.clientID"&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 07:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388300#M113226</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-01-08T07:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting value in a new created field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388301#M113227</link>
      <description>&lt;P&gt;Hi Kamlesh,&lt;/P&gt;

&lt;P&gt;Even if i run &lt;BR /&gt;
index=throwaway sourcetype=GIC-EMR-Wrapper-log_V1 | stats count(eval("errorResponse.ResponseCode"="CCEABR")) as "CCEABR Count"&lt;/P&gt;

&lt;P&gt;I get only 0 count &lt;/P&gt;

&lt;P&gt;but if i use i get some output like below.&lt;BR /&gt;
index=throwaway sourcetype=GIC-EMR-Wrapper-log_V1 errorResponse.ResponseCode="*" |stats count by errorResponse.ResponseCode&lt;/P&gt;

&lt;P&gt;errorResponse.ResponseCode  count&lt;BR /&gt;
CCEAIT                      2&lt;BR /&gt;
CPLOB   3&lt;BR /&gt;
null    6&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 07:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388301#M113227</guid>
      <dc:creator>csharm21</dc:creator>
      <dc:date>2019-01-08T07:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting value in a new created field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388302#M113228</link>
      <description>&lt;P&gt;@csharm21 add single quote for your field name inside eval expression as there is dot ( &lt;CODE&gt;.&lt;/CODE&gt; ) special character in the field name. Try replacing stats pipe with the following ans confirm!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats 
count(eval('errorResponse.ResponseCode'=="CCEABR")) as "CCEABR Count"
count(eval('errorResponse.ResponseCode'=="CCEAIT")) as "CCEAIT Count"
count(eval('errorResponse.ResponseCode'=="CCEAEE")) as "CCEAEE Count" 
count(eval('errorResponse.ResponseCode'=="AESCND")) as "AESCND Count" 
count(eval('errorResponse.ResponseCode'=="AESCEE")) as "AESCEE Count" 
count(eval('errorResponse.ResponseCode'=="AERCEE")) as "AERCEE Count" 
count(eval('errorResponse.ResponseCode'=="CPDNA")) as "CPDNA Count"
count(eval('errorResponse.ResponseCode'=="CPMNF")) as "CPMNF Count"
count(eval('errorResponse.ResponseCode'=="CPLOB")) as "CPLOB Count"
count(eval(isnull('errorResponse.TimeStamp'))) as "Timeout Count"
count(eval('errorResponse.JsonResponse'=="" or isnull('errorResponse.JsonResponse'))) as "Success/No Error Code Count"
by "requestSpecificElements.clientID" "requestSpecificElements.locationID"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Jan 2019 08:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388302#M113228</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-01-08T08:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting value in a new created field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388303#M113229</link>
      <description>&lt;P&gt;Thanks @niketnilay this worked for me.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 09:32:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-getting-value-in-a-new-created-field/m-p/388303#M113229</guid>
      <dc:creator>csharm21</dc:creator>
      <dc:date>2019-01-08T09:32:50Z</dc:date>
    </item>
  </channel>
</rss>

