<?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: implementing searchPostProcess in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191965#M11994</link>
    <description>&lt;P&gt;But wouldn't that mean, i am actually doing the search twice ? &lt;BR /&gt;
I wanted to do the common part of the search just once and use the results twice(saving time).&lt;/P&gt;</description>
    <pubDate>Mon, 11 May 2015 14:30:39 GMT</pubDate>
    <dc:creator>joydeep741</dc:creator>
    <dc:date>2015-05-11T14:30:39Z</dc:date>
    <item>
      <title>implementing searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191963#M11992</link>
      <description>&lt;P&gt;I have two almost similar queries as two panels in a dashboard. Can someone guide me how i can make use of searchPostProcessing in thies scenario&lt;BR /&gt;
&lt;STRONG&gt;Query 1&lt;/STRONG&gt;&lt;BR /&gt;
index=dotcom sourcetype=dotcom_access_log  |eval traffictype= &lt;BR /&gt;
case(&lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;/wcs/resources/store/10001&lt;/EM&gt; AND NOT uri_path=&lt;EM&gt;kiosk&lt;/EM&gt;"),"API HITS US", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;/wcs/resources/store/20001&lt;/EM&gt; AND NOT uri_path=&lt;EM&gt;kiosk&lt;/EM&gt;"),"API HITS CA", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;/cat_CL&lt;/EM&gt; OR uri_path=&lt;EM&gt;/directory_&lt;/EM&gt;"),"SEARCH HITS", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;/product_&lt;/EM&gt;"),"PRODUCT PAGE HITS", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;daily*deals&lt;/EM&gt;"),"DAILY DEALS HITS", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;kiosk&lt;/EM&gt;"),"KIOSK HITS", 1==1, "DESKTOP HITS")&lt;BR /&gt;&lt;BR /&gt;
|timechart count by traffictype&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Query 2&lt;/STRONG&gt;&lt;BR /&gt;
index=dotcom sourcetype=dotcom_access_log  |eval traffictype= &lt;BR /&gt;
case(&lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;/wcs/resources/store/10001&lt;/EM&gt; AND NOT uri_path=&lt;EM&gt;kiosk&lt;/EM&gt;"),"API HITS US",&lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;/wcs/resources/store/20001&lt;/EM&gt; AND NOT uri_path=&lt;EM&gt;kiosk&lt;/EM&gt;"),"API HITS CA", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;/cat_CL&lt;/EM&gt; OR uri_path=&lt;EM&gt;/directory_&lt;/EM&gt;"),"SEARCH HITS", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;/product_&lt;/EM&gt;"),"PRODUCT PAGE HITS", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;daily*deals&lt;/EM&gt;"),"DAILY DEALS HITS", &lt;BR /&gt;
searchmatch("uri_path=&lt;EM&gt;kiosk&lt;/EM&gt;"),"KIOSK HITS", 1==1, "DESKTOP HITS")&lt;BR /&gt;&lt;BR /&gt;
|timechart avg(eval((response_time/1000)/1000)) as "Response Time" by traffictype&lt;/P&gt;

&lt;P&gt;I am not able to write a common transforming search(which will act as the searchTemplate/base search) for these two queries even though they both are almost same except for the last part.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191963#M11992</guid>
      <dc:creator>joydeep741</dc:creator>
      <dc:date>2020-09-28T19:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: implementing searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191964#M11993</link>
      <description>&lt;P&gt;Probably macros should the job for you.&lt;/P&gt;

&lt;P&gt;Create a macro for your common search like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=dotcom sourcetype=dotcom_access_log |eval traffictype=&lt;BR /&gt;
case(&lt;BR /&gt;
searchmatch("uri_path=/wcs/resources/store/10001 AND NOT uri_path=kiosk"),"API HITS US",&lt;BR /&gt;
searchmatch("uri_path=/wcs/resources/store/20001 AND NOT uri_path=kiosk"),"API HITS CA",&lt;BR /&gt;
searchmatch("uri_path=/cat_CL OR uri_path=/directory_"),"SEARCH HITS",&lt;BR /&gt;
searchmatch("uri_path=/product_"),"PRODUCT PAGE HITS",&lt;BR /&gt;
searchmatch("uri_path=daily*deals"),"DAILY DEALS HITS",&lt;BR /&gt;
searchmatch("uri_path=kiosk"),"KIOSK HITS", 1==1, "DESKTOP HITS")&lt;/CODE&gt; to a macro named as you need.&lt;/P&gt;

&lt;P&gt;And you can call it in search like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(tilde symbol)macro_name(tilde symbol) |timechart count by traffictype&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;(tilde symbol)macro_name(tilde symbol) | timechart avg(eval((response_time/1000)/1000)) as "Response Time" by traffictype&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You can know more about macro &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Search/Usesearchmacros?r=searc"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 14:06:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191964#M11993</guid>
      <dc:creator>krish3</dc:creator>
      <dc:date>2015-05-11T14:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: implementing searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191965#M11994</link>
      <description>&lt;P&gt;But wouldn't that mean, i am actually doing the search twice ? &lt;BR /&gt;
I wanted to do the common part of the search just once and use the results twice(saving time).&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 14:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191965#M11994</guid>
      <dc:creator>joydeep741</dc:creator>
      <dc:date>2015-05-11T14:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: implementing searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191966#M11995</link>
      <description>&lt;P&gt;Try doing both &lt;CODE&gt;timechart&lt;/CODE&gt; functions in one base operation, and then in your postprocesses filter out the fields you want.&lt;/P&gt;

&lt;P&gt;Base search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... big common search
| timechart count, avg(eval((response_time/1000)/1000)) as "Response Time" by traffictype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Postprocess 1:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields _time count*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Postprocess 2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields _time "Response Time*"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2015 15:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191966#M11995</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-05-11T15:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: implementing searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191967#M11996</link>
      <description>&lt;P&gt;Thanks. That worked..!!&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 04:45:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/implementing-searchPostProcess/m-p/191967#M11996</guid>
      <dc:creator>joydeep741</dc:creator>
      <dc:date>2015-05-12T04:45:36Z</dc:date>
    </item>
  </channel>
</rss>

