<?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 a unique value on 0 event searches? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617499#M14437</link>
    <description>&lt;P&gt;I managed to find a solution which is to use&amp;nbsp;&lt;SPAN&gt;$job.latestTime$ instead. I have applied this to all our alerts now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is where I got the idea from:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/Setting-job-earliestTime-and-job-latestTime-tokens-for-the-date/m-p/345199" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/Setting-job-earliestTime-and-job-latestTime-tokens-for-the-date/m-p/345199&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 08:10:53 GMT</pubDate>
    <dc:creator>vishalduttauk</dc:creator>
    <dc:date>2022-10-18T08:10:53Z</dc:date>
    <item>
      <title>How to create a unique value on 0 event searches?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617135#M14409</link>
      <description>&lt;P&gt;I have a search which triggers an alert if an event hasn't be received by 6.20 am. That alert works fine but it needs to send data into another system. That system needs a unique id within it's Key field.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;key=$result._time$ won't work as&lt;/SPAN&gt;&amp;nbsp;the event doesn't exist.&lt;/P&gt;
&lt;P&gt;Is there a way to add a unique value into that key field on an event that doesn't exist?&lt;/P&gt;
&lt;P&gt;The search is:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sourcetype=Batch OR sourcetype=ManualBatch "Step 'CleanupOldRunlogs' finished with status SUCCESS"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 17:19:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617135#M14409</guid>
      <dc:creator>vishalduttauk</dc:creator>
      <dc:date>2022-10-14T17:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a unique value on 0 event searches</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617137#M14411</link>
      <description>&lt;P&gt;This is a job for &lt;FONT face="courier new,courier"&gt;appendpipe&lt;/FONT&gt;.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;appendpipe&lt;/FONT&gt; command runs commands against the current results and, among other things, lets you give values to fields when there are no results.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype=Batch OR sourcetype=ManualBatch "Step 'CleanupOldRunlogs' finished with status SUCCESS"
| appendpipe [ stats count | eval key="foo" | where count=0 | fields - count ]&lt;/LI-CODE&gt;&lt;P&gt;Here, &lt;FONT face="courier new,courier"&gt;appendpipe&lt;/FONT&gt; checks how many results there are and sets a value for the key field.&amp;nbsp; That value is shown only if count is zero.&amp;nbsp; Finally, the count field is discarded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 13:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617137#M14411</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-10-14T13:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a unique value on 0 event searches</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617140#M14413</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957" target="_blank"&gt;@richgalloway&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to make the value for key unique. i.e. the alert could be triggered today and tomorrow but i want each value to be different&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 14:15:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617140#M14413</guid>
      <dc:creator>vishalduttauk</dc:creator>
      <dc:date>2022-10-14T14:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a unique value on 0 event searches</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617152#M14416</link>
      <description>&lt;P&gt;You can set the key to the current timestamp.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval key=strftime(now(), "%Y-%m-%d %H:%M:%S")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:07:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617152#M14416</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-14T15:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a unique value on 0 event searches</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617153#M14417</link>
      <description>&lt;P&gt;You could set key to the current time.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype=Batch OR sourcetype=ManualBatch "Step 'CleanupOldRunlogs' finished with status SUCCESS"
| appendpipe [ stats count | eval key=now() | where count=0 | fields - count ]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:09:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617153#M14417</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-10-14T15:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a unique value on 0 event searches</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617171#M14421</link>
      <description>&lt;P&gt;I'd say whenever you can, store the time as a numeric timestamp, not as string. It's easier to manipulate, and you don't have to waste resources to parse it.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 16:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617171#M14421</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-10-14T16:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a unique value on 0 event searches</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617193#M14425</link>
      <description>&lt;P&gt;Epoch time works but it depends if you want it to be human readable or not on the 3rd party system.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 19:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617193#M14425</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-14T19:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a unique value on 0 event searches</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617196#M14426</link>
      <description>&lt;P&gt;Sure. In this case rendering the value to text seems to be a bit of an overkill. And it's always cheaper to render a timestamp to a string than to parse a string to a timestamp.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 19:48:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617196#M14426</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-10-14T19:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a unique value on 0 event searches?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617499#M14437</link>
      <description>&lt;P&gt;I managed to find a solution which is to use&amp;nbsp;&lt;SPAN&gt;$job.latestTime$ instead. I have applied this to all our alerts now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is where I got the idea from:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/Setting-job-earliestTime-and-job-latestTime-tokens-for-the-date/m-p/345199" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/Setting-job-earliestTime-and-job-latestTime-tokens-for-the-date/m-p/345199&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 08:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-unique-value-on-0-event-searches/m-p/617499#M14437</guid>
      <dc:creator>vishalduttauk</dc:creator>
      <dc:date>2022-10-18T08:10:53Z</dc:date>
    </item>
  </channel>
</rss>

