<?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 create flexible search strings? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506978#M141802</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222807"&gt;@thinhdinh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;No as I said, macros is the best solution for your need.&lt;/P&gt;&lt;P&gt;I usually use eventtypes and tags especially when I have to use different searches in one, e.g. if I have an eventtype for each kind of login (login of windows, login of linux, login of firewall, login of proxy, etc...) each with the same tag (e.g. LOGIN or LOGOUT or LOGFAIL), with only one command (e.g. tag=LOGIN) I take all these searches.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jul 2020 07:01:00 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-07-02T07:01:00Z</dc:date>
    <item>
      <title>How to create flexible search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506866#M141784</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I am wondering is there any ways to make the search strings flexibly? Like I have multiple queries as below:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- index=index_1 host=host_1 (scope=A OR scope=B) | ....&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- index=index_2 host=host_2 (scope=C OR scope=D) | ....&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- index=index_3 host=host_3 (scope=A OR scope=B OR scope=E OR scope=F) | ....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So instead of writting a macro with 3 arguments: $index$, $host$, $scopes$&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- customMacro(3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We just pass only index as argument and based on the number in the index, we modify the host and scope?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- host=case(match(index,1), host_1...)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thank in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 17:22:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506866#M141784</guid>
      <dc:creator>thinhdinh</dc:creator>
      <dc:date>2020-07-01T17:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create flexible search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506872#M141787</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222807"&gt;@thinhdinh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;macros is one solution.&lt;/P&gt;&lt;P&gt;I usually use eventtypes and tags in my apps because in this way I have only one point to modify when I have to change something.&lt;/P&gt;&lt;P&gt;In addition you can created indentated eventtypes:&lt;/P&gt;&lt;P&gt;eventtype_index: index=index1&lt;/P&gt;&lt;P&gt;eventtype_login_win; EventCode=4624&lt;/P&gt;&lt;P&gt;and use a combination of them.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 13:04:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506872#M141787</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-07-01T13:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create flexible search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506914#M141795</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;. This solution is new to me and sounds great! Anyway I am still looking for another way like where we create another macro to return value. So basically we have 2 more macro like below:&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;&lt;STRONG&gt;getHost(index)&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;getScope(index)&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Do you know any commands in Splunk supports us to to like this?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 17:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506914#M141795</guid>
      <dc:creator>thinhdinh</dc:creator>
      <dc:date>2020-07-01T17:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create flexible search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506978#M141802</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222807"&gt;@thinhdinh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;No as I said, macros is the best solution for your need.&lt;/P&gt;&lt;P&gt;I usually use eventtypes and tags especially when I have to use different searches in one, e.g. if I have an eventtype for each kind of login (login of windows, login of linux, login of firewall, login of proxy, etc...) each with the same tag (e.g. LOGIN or LOGOUT or LOGFAIL), with only one command (e.g. tag=LOGIN) I take all these searches.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 07:01:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-flexible-search-strings/m-p/506978#M141802</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-07-02T07:01:00Z</dc:date>
    </item>
  </channel>
</rss>

