<?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 How Do I Filter A Query By A Dynamic Created Eval Field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Filter-A-Query-By-A-Dynamic-Created-Eval-Field/m-p/168392#M48024</link>
    <description>&lt;P&gt;For example, in each log, I have start_date and end_date, they both together become eval length = ( end_date - start_date ).&lt;BR /&gt;
So I need my query to be like:&lt;/P&gt;

&lt;P&gt;index=test lenght=??/??/???? DD/MM/YYYY | timechart count by logs&lt;/P&gt;

&lt;P&gt;Is there a way I can create this dinamic field to be a fixed eval command for splunk? How do I do this?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:07:07 GMT</pubDate>
    <dc:creator>vtsguerrero</dc:creator>
    <dc:date>2020-09-28T19:07:07Z</dc:date>
    <item>
      <title>How Do I Filter A Query By A Dynamic Created Eval Field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Filter-A-Query-By-A-Dynamic-Created-Eval-Field/m-p/168392#M48024</link>
      <description>&lt;P&gt;For example, in each log, I have start_date and end_date, they both together become eval length = ( end_date - start_date ).&lt;BR /&gt;
So I need my query to be like:&lt;/P&gt;

&lt;P&gt;index=test lenght=??/??/???? DD/MM/YYYY | timechart count by logs&lt;/P&gt;

&lt;P&gt;Is there a way I can create this dinamic field to be a fixed eval command for splunk? How do I do this?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Filter-A-Query-By-A-Dynamic-Created-Eval-Field/m-p/168392#M48024</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2020-09-28T19:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Filter A Query By A Dynamic Created Eval Field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Filter-A-Query-By-A-Dynamic-Created-Eval-Field/m-p/168393#M48025</link>
      <description>&lt;P&gt;There might be a dynamic eval for a string as well, for example eval channel = (log_a + log_b + "channel")&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Filter-A-Query-By-A-Dynamic-Created-Eval-Field/m-p/168393#M48025</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2020-09-28T19:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Filter A Query By A Dynamic Created Eval Field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Filter-A-Query-By-A-Dynamic-Created-Eval-Field/m-p/168394#M48026</link>
      <description>&lt;P&gt;There are a couple of ways to handle this.  If you want this &lt;CODE&gt;length&lt;/CODE&gt; field to be created without having to perform an &lt;CODE&gt;eval&lt;/CODE&gt; statement in your search, you can add the &lt;CODE&gt;eval&lt;/CODE&gt; statement to your &lt;CODE&gt;props.conf&lt;/CODE&gt; file.  Once it's in there, Splunk will automatically eval that field at search time when it extracts the rest of your fields.  Add a statement like this to the appropriate &lt;CODE&gt;props.conf&lt;/CODE&gt; stanza(s):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-length = end_date - start_date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or, if you only want to filter on the &lt;CODE&gt;length&lt;/CODE&gt; field after you've eval'd it in a search, just add a &lt;CODE&gt;| search&lt;/CODE&gt; statement onto the end of your search.  This will filter your search results down by whatever your search string is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test rest of search terms | eval length=end_date-start_date | search length &amp;gt; foo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Mar 2015 18:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Filter-A-Query-By-A-Dynamic-Created-Eval-Field/m-p/168394#M48026</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2015-03-04T18:28:37Z</dc:date>
    </item>
  </channel>
</rss>

