<?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: Avoiding renaming multiple columns using time based streamstats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Avoiding-renaming-multiple-columns-using-time-based-streamstats/m-p/502153#M139772</link>
    <description>&lt;P&gt;You can avoid the separate &lt;CODE&gt;rename&lt;/CODE&gt; command by using the &lt;CODE&gt;as&lt;/CODE&gt; option in &lt;CODE&gt;streamstats&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| streamstats sum(*) as *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 Mar 2020 13:47:56 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-03-20T13:47:56Z</dc:date>
    <item>
      <title>Avoiding renaming multiple columns using time based streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Avoiding-renaming-multiple-columns-using-time-based-streamstats/m-p/502151#M139770</link>
      <description>&lt;P&gt;Hi there, &lt;/P&gt;

&lt;P&gt;I'm trying to create a time series data using &lt;CODE&gt;streamstats&lt;/CODE&gt; function. Got it figured out, but is there any way to avoid the &lt;CODE&gt;rename&lt;/CODE&gt; function and have the new columns produced by &lt;CODE&gt;streamstats&lt;/CODE&gt; replace the old values?&lt;/P&gt;

&lt;P&gt;I read the streamstats documentation, but didn't see any optional fields applied for my use cases (or I may not have understood it).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk_server=indexer* index=wsi sourcetype=fdpwsiperf partnerId!=*test* partnerId=* error_msg_service=* tax_year=2019 
ofx_appid=* capability=* 
| eval error_msg_service = case(error_msg_service="OK", "Success", match(error_msg_service, "Provider/Host Request Error"), 
"HTTP Request Error", match(error_msg_service, "Provider/Host Response Error"), "HTTP Response Error", 
match(error_msg_service, "Provider/Host Not Available"), "Server Exception", 1==1, "Import Failure") 
| timechart span=10m dc(intuit_tid) by error_msg_service 
| streamstats sum 
| rename "sum(Success)" as "Success", "sum(HTTP Request Error)" as "HTTP Request Error", "sum(HTTP Response Error)" as "HTTP 
Response Error", "sum(Import Failure)" as "Import Failure", "sum(Server Exception)" as "Server Exception"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 22:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Avoiding-renaming-multiple-columns-using-time-based-streamstats/m-p/502151#M139770</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-03-19T22:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding renaming multiple columns using time based streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Avoiding-renaming-multiple-columns-using-time-based-streamstats/m-p/502152#M139771</link>
      <description>&lt;P&gt;Also just to note, I followed an example in the documentation around applying &lt;CODE&gt;streamstats&lt;/CODE&gt; first and organizing it as a table with _time field, however, it doesn't look like &lt;CODE&gt;streamstats&lt;/CODE&gt; can accommodate embedded stats functions (I'm applying a sum to the count of a field).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk_server=indexer* index=wsi sourcetype=fdpwsiperf partnerId!=*test* partnerId=* 
error_msg_service=* tax_year=2019 ofx_appid=* capability=* 
| eval error_msg_service = case(error_msg_service="OK", "Success", match(error_msg_service, 
"Provider/Host Request Error"), "HTTP Request Error", match(error_msg_service, "Provider/Host Response 
Error"), "HTTP Response Error", match(error_msg_service, "Provider/Host Not Available"), "Server Exception", 
1==1, "Import Failure") 
| streamstats sum(dc(intuit_tid)) as import_requests by error_msg_service
| table _time, import_requests, error_msg_service
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Mar 2020 22:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Avoiding-renaming-multiple-columns-using-time-based-streamstats/m-p/502152#M139771</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-03-19T22:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding renaming multiple columns using time based streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Avoiding-renaming-multiple-columns-using-time-based-streamstats/m-p/502153#M139772</link>
      <description>&lt;P&gt;You can avoid the separate &lt;CODE&gt;rename&lt;/CODE&gt; command by using the &lt;CODE&gt;as&lt;/CODE&gt; option in &lt;CODE&gt;streamstats&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| streamstats sum(*) as *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2020 13:47:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Avoiding-renaming-multiple-columns-using-time-based-streamstats/m-p/502153#M139772</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-20T13:47:56Z</dc:date>
    </item>
  </channel>
</rss>

