<?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: Search strings in a different fields with different name under different indexes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559516#M158950</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234050"&gt;@splunkerer&lt;/a&gt;&amp;nbsp; | rex is for field extractions not for search. What you have written originally that is self sufficient though the command/arg values are long it does job well when you follow field = "value" rather than doing raw search.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you think the fields match many sourcetypes/source under index=A OR B then specify the sourcetype= , source= , host= (this is fundamental searching a whole index takes time) the more details you put in upfront to SPL then results would be narrowed down and faster.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jul 2021 00:43:24 GMT</pubDate>
    <dc:creator>venkatasri</dc:creator>
    <dc:date>2021-07-15T00:43:24Z</dc:date>
    <item>
      <title>Search strings in a different fields with different name under different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559503#M158947</link>
      <description>&lt;P&gt;I have two indexes including command line arguments, one has field name arg, the other one has field name command, what is the best practice to search some strings on both fields under different indexes to create alert if matches.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;index=A arg="*command_string_to_search*"&lt;BR /&gt;OR&amp;nbsp;&lt;BR /&gt;index=B command="*command_string_to_search*"&lt;BR /&gt;&lt;BR /&gt;How can we improve this search from performance standpoint?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 21:02:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559503#M158947</guid>
      <dc:creator>splunkerer</dc:creator>
      <dc:date>2021-07-14T21:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Search strings in a different fields with different name under different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559513#M158948</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234050"&gt;@splunkerer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you have written is fine as you have data in two different indexes. Fieldnames doesn't matter though they have common values as long as you have OR condition.&lt;/P&gt;&lt;P&gt;Couple of points to fine tune:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Try not to use leading wildcards, if you know upfront&amp;nbsp; just give full value there instead to start with * and end with *&lt;/LI&gt;&lt;LI&gt;use fields command&amp;nbsp; &amp;lt;your_search&amp;gt; | fields &amp;lt;field1&amp;gt; &amp;lt;field2&amp;gt; , this limits the processing of unnecessary fields hence impact on SH is minimal&lt;/LI&gt;&lt;LI&gt;if your fields arg, command are indexed fields try to see if you can use | tstats&lt;/LI&gt;&lt;LI&gt;If your SH pointed to various indexers ( pre-prod, prod etc) aka splunk_server field, if you upfront aware your indexer names then use splunk_server field&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;An upvote would be appreciated if this reply helps and Accept the solution!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 23:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559513#M158948</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-07-14T23:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Search strings in a different fields with different name under different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559515#M158949</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/163730"&gt;@venkatasri&lt;/a&gt;&amp;nbsp;for all great recommendations.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I was thinking it may be useful to use rex in a field instead of using a couple of heavy string? what do you think on that?&lt;BR /&gt;&lt;BR /&gt;| rex field=command "(string_1)|(string_2)|(string_3)|(strings_4)"&lt;/P&gt;&lt;P&gt;but the problem here is strings which will be searched can be anywhere of the field&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 00:26:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559515#M158949</guid>
      <dc:creator>splunkerer</dc:creator>
      <dc:date>2021-07-15T00:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Search strings in a different fields with different name under different indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559516#M158950</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234050"&gt;@splunkerer&lt;/a&gt;&amp;nbsp; | rex is for field extractions not for search. What you have written originally that is self sufficient though the command/arg values are long it does job well when you follow field = "value" rather than doing raw search.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you think the fields match many sourcetypes/source under index=A OR B then specify the sourcetype= , source= , host= (this is fundamental searching a whole index takes time) the more details you put in upfront to SPL then results would be narrowed down and faster.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 00:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-strings-in-a-different-fields-with-different-name-under/m-p/559516#M158950</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-07-15T00:43:24Z</dc:date>
    </item>
  </channel>
</rss>

