<?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 use an evaluated field in search command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600756#M209109</link>
    <description>&lt;P&gt;what if i use "where" command to set the source. does it impact the performance?&lt;/P&gt;&lt;P&gt;Example using #2 instead of #1&lt;/P&gt;&lt;P&gt;1. index=main sourcetype="access_combined" source="app1"&lt;/P&gt;&lt;P&gt;2. index=main sourcetype="access_combined" | where match(source,"app1")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jun 2022 20:05:34 GMT</pubDate>
    <dc:creator>biju_babu</dc:creator>
    <dc:date>2022-06-06T20:05:34Z</dc:date>
    <item>
      <title>How to use an evaluated field in search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600627#M209076</link>
      <description>&lt;P&gt;Could you please let me know how to use an evaluated field in search command&lt;/P&gt;
&lt;P&gt;index=main sourcetype="access_combined"&lt;/P&gt;
&lt;P&gt;| eval field1="search-val1|search-val2"&lt;/P&gt;
&lt;P&gt;| eval searchval=mvindex(split(field1,"|"),1)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;| search "*search-val2*"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I am trying to create a dashboard with one of the search as above. I&amp;nbsp;get the field1 value from dropdown list in dashboard. Something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| eval field1 = $searchkey$&lt;/P&gt;
&lt;P&gt;The above works with the static value in search command but I am trying to use searchval field in search command like&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;| search 'searchval'&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Can someone help?&amp;nbsp;Thanks for the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 03:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600627#M209076</guid>
      <dc:creator>biju_babu</dc:creator>
      <dc:date>2022-06-06T03:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Search with evaluated field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600634#M209078</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search [| makeresults
          | fields - _time
          | eval field1 = $searchval$]&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 05 Jun 2022 19:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600634#M209078</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-05T19:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Search with evaluated field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600635#M209079</link>
      <description>&lt;P&gt;sorry - that is not working.&lt;/P&gt;&lt;P&gt;Basically, I need to execute command like this&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=main sourcetype="access_combined" "&lt;STRONG&gt;*search-val2*&lt;/STRONG&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where "search-val2" get evaluate from pipe(|) separated&amp;nbsp;string&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jun 2022 20:14:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600635#M209079</guid>
      <dc:creator>biju_babu</dc:creator>
      <dc:date>2022-06-05T20:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an evaluated field in search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600647#M209083</link>
      <description>&lt;P&gt;Is there any reason why "search" is the only choice command? &amp;nbsp;Why not use&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Where" target="_blank" rel="noopener"&gt;where&lt;/A&gt;? &amp;nbsp;For example,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where match(_raw, searchval)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 05:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600647#M209083</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-06-06T05:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Search with evaluated field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600654#M209084</link>
      <description>&lt;P&gt;Do the separation in the makeresults subsearch&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search [| makeresults
          | fields - _time
          | eval field1 = $searchval$
          | eval query=mvindex(split(field1,"|"),1)
          | fields query]&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 06 Jun 2022 06:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600654#M209084</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-06T06:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an evaluated field in search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600756#M209109</link>
      <description>&lt;P&gt;what if i use "where" command to set the source. does it impact the performance?&lt;/P&gt;&lt;P&gt;Example using #2 instead of #1&lt;/P&gt;&lt;P&gt;1. index=main sourcetype="access_combined" source="app1"&lt;/P&gt;&lt;P&gt;2. index=main sourcetype="access_combined" | where match(source,"app1")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 20:05:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600756#M209109</guid>
      <dc:creator>biju_babu</dc:creator>
      <dc:date>2022-06-06T20:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an evaluated field in search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600775#M209116</link>
      <description>&lt;P&gt;This will affect performance mainly because the first search in #2 will return more events than that in #1.&lt;/P&gt;&lt;P&gt;As a side, if source is precisely "app1", do not use match(). &amp;nbsp;Just say | where source=="app1". &amp;nbsp;A callout to a function adds to memory and compute; and match() is a regex function, adds even more compute.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 04:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-an-evaluated-field-in-search-command/m-p/600775#M209116</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-06-07T04:47:50Z</dc:date>
    </item>
  </channel>
</rss>

