<?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: Case condition to check 2 events on the same field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634011#M220206</link>
    <description>&lt;P&gt;What have you tried so far?&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2023 06:52:00 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2023-03-10T06:52:00Z</dc:date>
    <item>
      <title>Case condition to check 2 events on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634010#M220205</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I want to write a case condition where i can check values from Range column.&lt;/P&gt;&lt;P&gt;For instance&lt;/P&gt;&lt;P&gt;If range for both &lt;STRONG&gt;cost &amp;amp; product is low&lt;/STRONG&gt; the a new column should show value as &lt;STRONG&gt;low&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If range for both &lt;STRONG&gt;Cost &amp;amp; Product = severe&lt;/STRONG&gt; then New Column should show &lt;STRONG&gt;severe&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If range for&amp;nbsp;&lt;STRONG&gt;Cost=severe &amp;amp; Product=low&lt;/STRONG&gt; OR if&lt;STRONG&gt; Cost=low &amp;amp; Product =severe&lt;/STRONG&gt; Then New column = &lt;STRONG&gt;elevated&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwini008_0-1678430514762.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24274iAFC9F948364DACDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ashwini008_0-1678430514762.png" alt="Ashwini008_0-1678430514762.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please suggest&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 06:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634010#M220205</guid>
      <dc:creator>Ashwini008</dc:creator>
      <dc:date>2023-03-10T06:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Case condition to check 2 events on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634011#M220206</link>
      <description>&lt;P&gt;What have you tried so far?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 06:52:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634011#M220206</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-03-10T06:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Case condition to check 2 events on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634019#M220208</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp; Tried Case condition with the existing field but only default condition is matching&lt;/P&gt;&lt;P&gt;Also, tried to get results in separate columns yet getting only default condition value i.e. 0&lt;BR /&gt;&lt;BR /&gt;Field name differs in below code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fillnull value=NA rangecost rangeproduct 
 | eval Valuecombine=case(((rangecost="low" AND Metric="Cost") AND (rangeproduct="low" AND Metric="Product")),"1",((rangecost="severe" AND Metric="Cost") AND (rangeproduct="severe" AND Metric="Product")),"2",((rangecost="low" AND Metric="Cost") AND (rangeproduct="severe" AND Metric="Product")),"3",((rangecost="severe" AND Metric="Cost") AND (rangeproduct="low" AND Metric="Product")),"4",1=1,0) 
| table Metric Application rangeproduct rangecost Valuecombine&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Valuecombine=case(rangeproduct="low" AND rangecost="low","1",rangeproduct="severe" AND rangecost="severe","2",rangeproduct="low" AND rangecost="severe","3",rangeproduct="severe" AND rangecost="low","4",1=1,0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 07:43:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634019#M220208</guid>
      <dc:creator>Ashwini008</dc:creator>
      <dc:date>2023-03-10T07:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Case condition to check 2 events on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634022#M220209</link>
      <description>&lt;P&gt;OK. Different metrics are in separate events so you can't really do a single row eval to match/compare/whatever them. Also the requirement about adding a column where there are two separate rows seems a bit imprecise. Is there an additional field which "groups" the metrics? The Application field? If so, you should first use xyseries to combine different metrics to a single row by that identifier. Then you can use your eval with case or whatever you want.&lt;/P&gt;&lt;PRE&gt;| xyseries Application Metric range&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Mar 2023 07:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634022#M220209</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-03-10T07:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Case condition to check 2 events on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634027#M220211</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;Thanks, But i need the result to be as before i.e. Metric Application range new column&amp;nbsp; and untable isnt working here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwini008_0-1678438514721.png" style="width: 507px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24277iB3194B9763BF5941/image-dimensions/507x133?v=v2" width="507" height="133" role="button" title="Ashwini008_0-1678438514721.png" alt="Ashwini008_0-1678438514721.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 08:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634027#M220211</guid>
      <dc:creator>Ashwini008</dc:creator>
      <dc:date>2023-03-10T08:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Case condition to check 2 events on the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634034#M220212</link>
      <description>&lt;P&gt;But what meaning would the additional colum have to have if it was "attached" to only one parameter?&lt;/P&gt;&lt;P&gt;You want to have the same value in both rows? Do xyseries and then untable (yes, untable might be tricky if you have multiple columns; you'd need to "pack" and "unpack" them) or do eventstats.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 09:40:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-condition-to-check-2-events-on-the-same-field/m-p/634034#M220212</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-03-10T09:40:02Z</dc:date>
    </item>
  </channel>
</rss>

