<?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: Splunk search eval or other command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746319#M241616</link>
    <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;How can I use eval like here?&lt;/P&gt;&lt;P&gt;I mean here status field contains someother text before and after the&amp;nbsp;'Host is down' and 'database is down' values and it varies every event.&lt;/P&gt;&lt;P&gt;just wanted to put status=like(*host is down*)&lt;/P&gt;</description>
    <pubDate>Fri, 16 May 2025 13:02:34 GMT</pubDate>
    <dc:creator>Harikiranjammul</dc:creator>
    <dc:date>2025-05-16T13:02:34Z</dc:date>
    <item>
      <title>Splunk search eval or other command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746310#M241613</link>
      <description>&lt;P&gt;Have events like below&lt;/P&gt;&lt;P&gt;1) date-Timestamp&lt;/P&gt;&lt;P&gt;Server - hostname&lt;/P&gt;&lt;P&gt;Status - host is down&lt;/P&gt;&lt;P&gt;Threshold - unable to ping&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date-Timestamp&lt;/P&gt;&lt;P&gt;Db - dbname&lt;/P&gt;&lt;P&gt;Status- database is down&lt;/P&gt;&lt;P&gt;Instance status- DB instance is not available&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would need to write Eval condition and create new field description that if field status is " database is down" , I need to add date, dB, status, Instances status fields to description field&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if status is host down, need to add date,server, status, threshold to description field.&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 10:47:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746310#M241613</guid>
      <dc:creator>Harikiranjammul</dc:creator>
      <dc:date>2025-05-16T10:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search eval or other command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746311#M241614</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval description=case(Status="host is down",Date.",".Server.",".Status.",".Threshold,Status="database is down",Date.",".Db.",".Status.",".'Instance status')&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 May 2025 11:28:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746311#M241614</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-05-16T11:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search eval or other command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746315#M241615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/258992"&gt;@Harikiranjammul&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use an eval statement with a conditional to build the description field based on the value of status.&lt;/P&gt;&lt;PRE&gt;|makeresults | eval Server="host1", Status="host is down", Threshold="unable to ping"&lt;BR /&gt;| append [| makeresults | eval Db="db1", Status="database is down", Instance_status="DB instance is not available"]&lt;BR /&gt;| eval date=strftime(_time, "%d/%m/%Y %H:%M:%S")&lt;BR /&gt;| eval description=case(&lt;BR /&gt;Status=="database is down", "date=" . date . " Db=" . Db . " Status=" . Status . " Instance_status=" . Instance_status,&lt;BR /&gt;Status=="host is down", "date=" . date . " Server=" . Server . " Status=" . Status . " Threshold=" . Threshold&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This SPL checks the Status field and constructs the description field by concatenating the relevant fields for each case.&lt;/P&gt;&lt;P&gt;Ensure your field names match exactly (case-sensitive) and are extracted correctly before using this logic.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 12:22:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746315#M241615</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-05-16T12:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search eval or other command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746319#M241616</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;How can I use eval like here?&lt;/P&gt;&lt;P&gt;I mean here status field contains someother text before and after the&amp;nbsp;'Host is down' and 'database is down' values and it varies every event.&lt;/P&gt;&lt;P&gt;just wanted to put status=like(*host is down*)&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 13:02:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746319#M241616</guid>
      <dc:creator>Harikiranjammul</dc:creator>
      <dc:date>2025-05-16T13:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search eval or other command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746328#M241617</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/258992"&gt;@Harikiranjammul&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can, restrict the first part of the search by adding&lt;/P&gt;&lt;P&gt;(Status="*host is down* OR Status="*Some other criteria*")&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 14:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746328#M241617</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-05-16T14:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search eval or other command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746340#M241619</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval description=case(like(Status,"%host is down%"),Date.",".Server.",".Status.",".Threshold,like(Status,"%database is down%"),Date.",".Db.",".Status.",".'Instance status')&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 May 2025 15:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-eval-or-other-command/m-p/746340#M241619</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-05-16T15:22:22Z</dc:date>
    </item>
  </channel>
</rss>

