<?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 to create a script command in a ksh in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-a-script-command-in-a-ksh/m-p/536016#M151529</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have some alerts that send an email with the events to me if triggered. I need to create a custom script for the alerts that check if that splunk indexer is the indexer that should be is receiving events from our application logs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our application can run in two cities but only one city is active. We actually failover if necessary to the other city, so the splunk indexer &lt;EM&gt;in that city&lt;/EM&gt;&amp;nbsp; &lt;EM&gt;only&lt;/EM&gt;&amp;nbsp; will receive events from the application logs.&amp;nbsp; I cannot keep alerts from both indexers active, so the standby city needs to have all its alerts disabled.&amp;nbsp; We failover manually which causes us to manually disable alerts on indexer in the city we are switching &lt;EM&gt;from&lt;/EM&gt; and enable the alerts in the city we are switching &lt;EM&gt;to. I&lt;U&gt; need to all the alerts enabled at both cities all the time&lt;/U&gt;.&amp;nbsp; &lt;/EM&gt;I need the alerts to do an nslookup of the IP that is active for the application and if that IP is on &lt;EM&gt;that&lt;/EM&gt; indexer's side then the alert is valid and should email the events to me. If the IP is not on that indexer's side, the alert is a false positive and nothing needs to get emailed.&amp;nbsp; Any help is appreciated&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2021 15:05:43 GMT</pubDate>
    <dc:creator>riotto</dc:creator>
    <dc:date>2021-01-15T15:05:43Z</dc:date>
    <item>
      <title>how to create a script command in a ksh</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-a-script-command-in-a-ksh/m-p/536016#M151529</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have some alerts that send an email with the events to me if triggered. I need to create a custom script for the alerts that check if that splunk indexer is the indexer that should be is receiving events from our application logs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our application can run in two cities but only one city is active. We actually failover if necessary to the other city, so the splunk indexer &lt;EM&gt;in that city&lt;/EM&gt;&amp;nbsp; &lt;EM&gt;only&lt;/EM&gt;&amp;nbsp; will receive events from the application logs.&amp;nbsp; I cannot keep alerts from both indexers active, so the standby city needs to have all its alerts disabled.&amp;nbsp; We failover manually which causes us to manually disable alerts on indexer in the city we are switching &lt;EM&gt;from&lt;/EM&gt; and enable the alerts in the city we are switching &lt;EM&gt;to. I&lt;U&gt; need to all the alerts enabled at both cities all the time&lt;/U&gt;.&amp;nbsp; &lt;/EM&gt;I need the alerts to do an nslookup of the IP that is active for the application and if that IP is on &lt;EM&gt;that&lt;/EM&gt; indexer's side then the alert is valid and should email the events to me. If the IP is not on that indexer's side, the alert is a false positive and nothing needs to get emailed.&amp;nbsp; Any help is appreciated&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 15:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-a-script-command-in-a-ksh/m-p/536016#M151529</guid>
      <dc:creator>riotto</dc:creator>
      <dc:date>2021-01-15T15:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a script command in a ksh</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-a-script-command-in-a-ksh/m-p/536054#M151551</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/182063"&gt;@riotto&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can lookup ip address to filter alert result in your alert search like below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;**As an example activeidx.acme.com resolves 10.1.1.1 which is current indexer. You should put its own resolved ip address in each city indexer.

| your search for alert
append [| makeresults | eval idx_fqdn="activeidx.acme.com" | lookup dnslookup clienthost as idx_fqdn OUTPUT clientip | fields clientip ]
| eventstats latest(clientip) as my_ip
| where my_ip="10.1.1.1"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 20:34:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-a-script-command-in-a-ksh/m-p/536054#M151551</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-15T20:34:56Z</dc:date>
    </item>
  </channel>
</rss>

