Advertisement
Guest User

drilldown example for dspracklen

a guest
Nov 20th, 2012
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.92 KB | None | 0 0
  1. <!-- Copyright (C) 2010-2012 Sideview LLC.  All Rights Reserved. -->
  2. <view autoCancelInterval="90" onunloadCancelJobs="true" template="search.html" isSticky="False" isVisible="False">
  3.   <label>dspracklen</label>
  4.   <module name="AccountBar" layoutPanel="appHeader" />
  5.   <module name="AppBar" layoutPanel="appHeader" />
  6.   <module name="SideviewUtils" layoutPanel="appHeader" />
  7.  
  8.   <module name="Message" layoutPanel="messaging">
  9.     <param name="filter">*</param>
  10.     <param name="maxSize">2</param>
  11.     <param name="clearOnJobDispatch">False</param>
  12.   </module>
  13.  
  14.   <module name="HTML" layoutPanel="viewHeader">
  15.     <param name="html"><![CDATA[
  16.    <h1>drilldown example for dspracklen</h1>
  17.    ]]></param>
  18.   </module>
  19.  
  20.   <module name="URLLoader" layoutPanel="viewHeader" autoRun="True">
  21.     <param name="keepURLUpdated">True</param>
  22.    
  23.     <module name="Search">
  24.       <param name="search">index=_internal sourcetype=splunkd component=metrics group=per_sourcetype_thruput | timechart max(eps) by series</param>
  25.       <param name="earliest">-7d</param>
  26.  
  27.       <module name="JobProgressIndicator"></module>
  28.  
  29.       <module name="HiddenChartFormatter">
  30.         <param name="charting.chart">column</param>
  31.         <param name="charting.chart.stackMode">stacked</param>
  32.        
  33.         <module name="FlashChart">
  34.           <param name="height">150px</param>
  35.  
  36.           <module name="HTML">
  37.             <param name="html"><![CDATA[
  38.              <b>legacy keys:</b><br>
  39.              click.value = $click.value$<br>
  40.              click.name2 = $click.name2$<br>
  41.              <br>
  42.              Note:  With FlashChart $$click.value$$ will be an isotime string. With JSChart it will be epochtime. Either way it doesn't matter because we don't use that key here.
  43.              <br>
  44.              <b>sideview keys:</b><br>
  45.              
  46.              search.timeRange.earliest= $search.timeRange.earliest$<br>
  47.              search.timeRange.latest= $search.timeRange.latest$<br>
  48.              search.timeRange.label= $search.timeRange.label$<br>
  49.              <br>
  50.  
  51.              click.searchTerms = $click.searchTerms$<br>
  52.              <br>
  53.              Note: Generally you would use only click.searchTerms in your search string, and that's it. Nothing else.   For time,  you just let the modules themselves handle the time arguments into the drilldown search.  More precisely, downstream from time drilldowns on all tables and charts, the time bounds of the clicked-upon time bucket will be passed by default to all drilldown searches.  No special syntax or trickery is required.
  54.            ]]></param>
  55.           </module>
  56.          
  57.           <!-- now we do some odd magic to convert the times into the exact
  58.          string-formatted times that you wanted.
  59.          
  60.          the following strange looking syntax:
  61.             | stats count | fields - count
  62.          is a way to create a search result with 1 row,  with no fields at all....
  63.          we then use eval to build ourselves a field value with your string time.
  64.          -->
  65.  
  66.           <module name="Search">
  67.             <param name="search">| stats count | fields - count | eval formattedDrilldownTime=strftime("$search.timeRange.earliest$","%Y-%m-%d %H:%M:%S.%3N %z")</param>
  68.  
  69.             <module name="ResultsValueSetter">
  70.               <param name="fields">formattedDrilldownTime</param>
  71.  
  72.               <module name="HTML">
  73.                 <param name="html"><![CDATA[
  74.                  <b>custom-string-formatted time key: </b><br>
  75.                  formattedDrilldownTime: $formattedDrilldownTime$<br>
  76.                  <br>
  77.                  To use this in a drilldown search simply nest your Search module inside the ResultsValueSetter and use the key in your search.
  78.                ]]></param>
  79.               </module>
  80.             </module>
  81.  
  82.              
  83.           </module>
  84.         </module>
  85.       </module>
  86.     </module>
  87.   </module>
  88. </view>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement