<?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: How to edit my search to do an eval match and if so, to plot a timechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372529#M109574</link>
    <description>&lt;P&gt;@howardroark, You can do wildcard search in the base query which should still be faster than an eval later:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index="ABC" cs_uri_stem="XYZ" cs_uri_query="*content*"
 | timechart avg(time_taken) as AvgTime 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Jun 2017 03:42:52 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-06-29T03:42:52Z</dc:date>
    <item>
      <title>How to edit my search to do an eval match and if so, to plot a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372526#M109571</link>
      <description>&lt;P&gt;I am trying to plot a timechart with a the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ABC"  cs_uri_stem = "XYZ"
| timechart eval( if(match(cs_uri_query,"A"),avg(time_taken))) as AvgTime by cs_uri_stem
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically, I am trying to match a string in a sentence and based on that if its found then take the average time_taken else do nothing.&lt;/P&gt;

&lt;P&gt;How can I achieve this?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 20:34:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372526#M109571</guid>
      <dc:creator>howardroark</dc:creator>
      <dc:date>2017-06-27T20:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to do an eval match and if so, to plot a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372527#M109572</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30125"&gt;@howardroark&lt;/a&gt;, if you do nothing in the else block then you are complicating your use case. You can just filter the required events i.e. cs_uri_query="A" in your base search itself (which will also return results faster). Further you do not need &lt;CODE&gt;by cs_uri_stem&lt;/CODE&gt; since you are anyways filtering to only one record in base search i.e. "XYZ"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="ABC" cs_uri_stem="XYZ" cs_uri_query="A"
| timechart avg(time_taken) as AvgTime 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:39:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372527#M109572</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T14:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to do an eval match and if so, to plot a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372528#M109573</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt; Sure, though its not the complete cs_uri_query that i am interested in. I am interested in a keyword present in the query string. Can I filter out based on that. Say "content" keyword in "type=content&amp;amp;source=%size%" cs_uri_query?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:36:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372528#M109573</guid>
      <dc:creator>howardroark</dc:creator>
      <dc:date>2020-09-29T14:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to do an eval match and if so, to plot a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372529#M109574</link>
      <description>&lt;P&gt;@howardroark, You can do wildcard search in the base query which should still be faster than an eval later:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index="ABC" cs_uri_stem="XYZ" cs_uri_query="*content*"
 | timechart avg(time_taken) as AvgTime 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 03:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372529#M109574</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-06-29T03:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to do an eval match and if so, to plot a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372530#M109575</link>
      <description>&lt;P&gt;Also you can perform match during stats/timechart command using eval&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index="ABC" cs_uri_stem="XYZ" cs_uri_query="*content*"
  | timechart avg(eval(match(cs_uri_query,"content"))) as AvgTime 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, avg is depended on number of buckets of time where cs_uri_query matched as expected. So you might have to get count instead of avg and compute avg based on number of buckets instead.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-do-an-eval-match-and-if-so-to-plot-a/m-p/372530#M109575</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T14:43:43Z</dc:date>
    </item>
  </channel>
</rss>

