<?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 for a string in field , if not there then trigger alert with remaining data in fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568880#M198279</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;your need is a two phases check:&lt;UL&gt;&lt;LI&gt;check if in Field2 there's the string "Successful",&lt;/LI&gt;&lt;LI&gt;then display the values of the Field2 field below "Successful"&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is this correct?&lt;/P&gt;&lt;P&gt;If this is your need, please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index ield2=*
| transaction startswith="Successful"
| mvexpand field2
| search field2!="Successful"
| table _time field2&lt;/LI-CODE&gt;&lt;P&gt;if the number of events after "Successful" is fixes (e.g. always 2), you could be more precise adding an option to the transaction command "maxevents=2".&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 29 Sep 2021 06:58:32 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-09-29T06:58:32Z</dc:date>
    <item>
      <title>search for a string in field , if not there then trigger alert with remaining data in fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568879#M198278</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to check for a string in the field, but if the string is not found in the field then need to print the remaining data. (last 15 mins data)&lt;BR /&gt;&lt;BR /&gt;for example,&lt;/P&gt;&lt;P&gt;Field1&amp;nbsp; &amp;nbsp; &amp;nbsp; Field2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;9/2/10&amp;nbsp; &amp;nbsp;successful&lt;BR /&gt;9/2/10&amp;nbsp; &amp;nbsp;creating the file&lt;BR /&gt;9/2/10&amp;nbsp; &amp;nbsp;created&lt;BR /&gt;&lt;BR /&gt;from the above table, I want to check the Field2 for the last 15mins for string "successful", if no string is found in Field2 with "successful", Then need to trigger an alert with the remaining data like below.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Field1&amp;nbsp; &amp;nbsp; &amp;nbsp; Field2&amp;nbsp;&lt;BR /&gt;9/2/10&amp;nbsp; &amp;nbsp;creating the file&lt;BR /&gt;9/2/10&amp;nbsp; &amp;nbsp;created&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;is this possbile in splunk.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 06:40:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568879#M198278</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2021-09-29T06:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: search for a string in field , if not there then trigger alert with remaining data in fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568880#M198279</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;your need is a two phases check:&lt;UL&gt;&lt;LI&gt;check if in Field2 there's the string "Successful",&lt;/LI&gt;&lt;LI&gt;then display the values of the Field2 field below "Successful"&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is this correct?&lt;/P&gt;&lt;P&gt;If this is your need, please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index ield2=*
| transaction startswith="Successful"
| mvexpand field2
| search field2!="Successful"
| table _time field2&lt;/LI-CODE&gt;&lt;P&gt;if the number of events after "Successful" is fixes (e.g. always 2), you could be more precise adding an option to the transaction command "maxevents=2".&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 06:58:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568880#M198279</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-29T06:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: search for a string in field , if not there then trigger alert with remaining data in fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568884#M198281</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@gcusello&amp;nbsp;&lt;BR /&gt;Thank you, but my intention is to trigger an alert with the remaining data in Field2.&lt;BR /&gt;if there is no string("Successful") at all in&amp;nbsp;Field2.&lt;/P&gt;&lt;P&gt;sample alert,&lt;/P&gt;&lt;P&gt;no log found for successful, Please find logs&lt;/P&gt;&lt;P&gt;Field1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Field2&lt;BR /&gt;9/2/10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;creating the file&lt;BR /&gt;9/2/10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;created&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 07:30:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568884#M198281</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2021-09-29T07:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: search for a string in field , if not there then trigger alert with remaining data in fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568886#M198282</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index field2=*
| eval check=if(field2="Successful","Yes","No")
| stats values(EventCode) AS EventCode values(check) AS check dc(check) AS dc_check earliest(_time) AS _time
| search dc_check=1 check=No
| mvexpand field2
| table _time field2&lt;/LI-CODE&gt;&lt;P&gt;in this way, you check if in your logs there's the "Successful" string:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if present, there's no result in the search,&lt;/LI&gt;&lt;LI&gt;if not present, it displays all the field2 values.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 07:48:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568886#M198282</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-29T07:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: search for a string in field , if not there then trigger alert with remaining data in fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568898#M198284</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=your_index Field2=*
| eval check=if(Field2="Successful","Yes",null())
| eventstats values(check) AS check
| where isnull(check)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Sep 2021 08:57:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-for-a-string-in-field-if-not-there-then-trigger-alert/m-p/568898#M198284</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-29T08:57:52Z</dc:date>
    </item>
  </channel>
</rss>

