title: Splunk - Stats search count by day with percentage against day-total
body: <p>The use-case I have is to provide the count of a certain error (searched by a certain pattern) by day and provide a percentage of such 'errored' requests against the total number of requests (searched without the error pattern) handled every day. Unable to form the appropriate query for it. The base queries are -</p>
  
  <p>Get total counts for each day:</p>
  
  <pre><code>index=my_index | bucket _time span=day | stats count by _time
  </code></pre>
  
  <p>Get just errors for each day:</p>
  
  <pre><code>index=my_index "Error-Search-Pattern" | bucket _time span=day | stats count by _time
  </code></pre>
  
  <p>How do I combine the two counts to show up side-by-side and show the error:total percentage? </p>
  
  <p>Thanks in advance.</p>