<?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: Comparing fields of different events in the same log file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-fields-of-different-events-in-the-same-log-file/m-p/587140#M204487</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243521"&gt;@gaishi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you want to check the presence of a predefined pattern (e.g. "bbb"), you could run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| eval check=if(searchmatch("bbb"),"yes","not")
| table _time _raw check&lt;/LI-CODE&gt;&lt;P&gt;If instead you want to check the patterns in your logs, there's a tab in the search dashboard.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 08:33:56 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-03-02T08:33:56Z</dc:date>
    <item>
      <title>Comparing fields of different events in the same log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-fields-of-different-events-in-the-same-log-file/m-p/587101#M204473</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'd like to compare events in the same log files, amusing the format of the events are the same. For example:&lt;/P&gt;&lt;P&gt;event1: ccc, ddd&lt;/P&gt;&lt;P&gt;event2: bbb, ccc&lt;/P&gt;&lt;P&gt;event3: aaa, bbb&lt;/P&gt;&lt;P&gt;As you can see there's a pattern, the 2nd part (bbb) in event3 is always the same as the 1st part in event2, and the 2nd part in event 2 (ccc) is always the same as the 1st part in event 1.&lt;/P&gt;&lt;P&gt;My question is how do I check if all the events in the same log file match this pattern. Thank you in advance!&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Gai&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 01:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-fields-of-different-events-in-the-same-log-file/m-p/587101#M204473</guid>
      <dc:creator>gaishi</dc:creator>
      <dc:date>2022-03-02T01:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields of different events in the same log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-fields-of-different-events-in-the-same-log-file/m-p/587140#M204487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243521"&gt;@gaishi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you want to check the presence of a predefined pattern (e.g. "bbb"), you could run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| eval check=if(searchmatch("bbb"),"yes","not")
| table _time _raw check&lt;/LI-CODE&gt;&lt;P&gt;If instead you want to check the patterns in your logs, there's a tab in the search dashboard.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 08:33:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-fields-of-different-events-in-the-same-log-file/m-p/587140#M204487</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-02T08:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields of different events in the same log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-fields-of-different-events-in-the-same-log-file/m-p/587170#M204495</link>
      <description>&lt;P&gt;Assuming you have fields called field1 and field2, and your events are already in the order you want to compare.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats window=2 current=f values(field1) as previous_field1
| eval match2withprevious1=if(field2=previous_field1,"match","not match")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Mar 2022 10:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-fields-of-different-events-in-the-same-log-file/m-p/587170#M204495</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-02T10:19:13Z</dc:date>
    </item>
  </channel>
</rss>

