<?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 Eval check condition not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-check-condition-not-working/m-p/471898#M132769</link>
    <description>&lt;P&gt;Hello, I have the splunk query below which has multiple sourcetype rows and if the row has x-correlation-id keywpord matching it needs to return Status x-correlation-id (or) return missing otherwise, there are couple of rows which has x-correlation-id in header and all rows are currently returning as "missing" , any ideas why the match is not working ?&lt;/P&gt;

&lt;P&gt;environment=prod sourcetype=* "x-correlation-id" | fields sourcetype, Properties.Headers{} , Properties.CorrelationId, CorrelationId, Category | eval Status=if(match("Properties.Headers{}", "X-Correlation-id"),"x-correlation-id", "missing") | dedup sourcetype | table  sourcetype,Status,  Properties.CorrelationId, CorrelationId, Category | sort str(Properties.Headers{})&lt;/P&gt;

&lt;P&gt;sourcetype    status                  Properties.CorrelationId&lt;BR /&gt;&lt;BR /&gt;
o1                   missing              c1&lt;BR /&gt;&lt;BR /&gt;
o2            missing              c2&lt;BR /&gt;&lt;BR /&gt;
o3        missing                 c3&lt;BR /&gt;&lt;BR /&gt;
o4              missing               c4&lt;BR /&gt;&lt;BR /&gt;
o5              missing           c5&lt;BR /&gt;
o6             missing                         c6&lt;BR /&gt;&lt;BR /&gt;
o7             missing                       c7&lt;BR /&gt;&lt;BR /&gt;
08            missing                      c8   &lt;/P&gt;</description>
    <pubDate>Mon, 13 Apr 2020 20:34:12 GMT</pubDate>
    <dc:creator>msrama5</dc:creator>
    <dc:date>2020-04-13T20:34:12Z</dc:date>
    <item>
      <title>Eval check condition not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-check-condition-not-working/m-p/471898#M132769</link>
      <description>&lt;P&gt;Hello, I have the splunk query below which has multiple sourcetype rows and if the row has x-correlation-id keywpord matching it needs to return Status x-correlation-id (or) return missing otherwise, there are couple of rows which has x-correlation-id in header and all rows are currently returning as "missing" , any ideas why the match is not working ?&lt;/P&gt;

&lt;P&gt;environment=prod sourcetype=* "x-correlation-id" | fields sourcetype, Properties.Headers{} , Properties.CorrelationId, CorrelationId, Category | eval Status=if(match("Properties.Headers{}", "X-Correlation-id"),"x-correlation-id", "missing") | dedup sourcetype | table  sourcetype,Status,  Properties.CorrelationId, CorrelationId, Category | sort str(Properties.Headers{})&lt;/P&gt;

&lt;P&gt;sourcetype    status                  Properties.CorrelationId&lt;BR /&gt;&lt;BR /&gt;
o1                   missing              c1&lt;BR /&gt;&lt;BR /&gt;
o2            missing              c2&lt;BR /&gt;&lt;BR /&gt;
o3        missing                 c3&lt;BR /&gt;&lt;BR /&gt;
o4              missing               c4&lt;BR /&gt;&lt;BR /&gt;
o5              missing           c5&lt;BR /&gt;
o6             missing                         c6&lt;BR /&gt;&lt;BR /&gt;
o7             missing                       c7&lt;BR /&gt;&lt;BR /&gt;
08            missing                      c8   &lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 20:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-check-condition-not-working/m-p/471898#M132769</guid>
      <dc:creator>msrama5</dc:creator>
      <dc:date>2020-04-13T20:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Eval check condition not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-check-condition-not-working/m-p/471899#M132770</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;environment=prod sourcetype=* "x-correlation-id" 
| fields sourcetype, Properties.Headers{} , Properties.CorrelationId, CorrelationId, Category 
| rename Properties.Headers{} as Properties_Headers , Properties.CorrelationId as Properties_CorrelationId
| stats latest(*) as * by sourcetype
| eval Status=if(match(Properties_Headers, "(?i)X-Correlation-id"),"x-correlation-id", "missing")
| sort str(Properties_Headers)
| table sourcetype, Status, Properties_CorrelationId, CorrelationId, Category 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;match()&lt;/CODE&gt; use REGEX , this is case-sensitive.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 23:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-check-condition-not-working/m-p/471899#M132770</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-13T23:25:25Z</dc:date>
    </item>
  </channel>
</rss>

