<?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: How to build a table out of this log file? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-table-out-of-this-log-file/m-p/610773#M212408</link>
    <description>&lt;P&gt;You may already have fields that exist, but this example assumes the data you supplied is the raw data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval x=split("2022-05-22 02:02:20 PM UTC False [Android] Password Expiration Notice###2022-05-22 06:05:49 PM UTC True [Home] [Android] Password Expiration Notice###2022-05-29 04:24:52 AM UTC False [Android] High Memory usage Google###2022-05-29 06:05:49 PM UTC True [Android] Password Expiration Notice", "###")
| mvexpand x
| fields - _time
| rename x as _raw
| rex "(?&amp;lt;t&amp;gt;\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} \w{2} [^ ]*) (?&amp;lt;bool&amp;gt;(True|False)) ((?&amp;lt;home&amp;gt;\[Home\])? )?(?&amp;lt;platform&amp;gt;\[[^\]]*\]) (?&amp;lt;Issue&amp;gt;.*)"
| stats count(eval(bool="False")) as False count(eval(bool="True")) as True count(eval(home="[Home]")) as Home by Issue
| eval False = False - Home
| table Issue True False&lt;/LI-CODE&gt;&lt;P&gt;rex statement parses out the fields and then the stats does the basic calcs and the False is adjusted at the end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2022 04:19:43 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-08-25T04:19:43Z</dc:date>
    <item>
      <title>How to build a table out of this log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-table-out-of-this-log-file/m-p/610770#M212407</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have below log file, I would like to build a table out of it (Line1, Line2,Line3,Line4 are just for understanding)&lt;/P&gt;
&lt;P&gt;Line1: 2022-05-22 02:02:20 PM UTC &lt;STRONG&gt;False&lt;/STRONG&gt; [Android] Password Expiration Notice&lt;BR /&gt;Line2: 2022-05-22 06:05:49 PM UTC &lt;STRONG&gt;True [Home]&lt;/STRONG&gt; [Android] Password Expiration Notice&lt;BR /&gt;Line3: 2022-05-29 04:24:52 AM UTC &lt;STRONG&gt;False&lt;/STRONG&gt; [Android] High Memory usage Google&lt;BR /&gt;Line4: 2022-05-29 06:05:49 PM UTC &lt;STRONG&gt;True&lt;/STRONG&gt; [Android] Password Expiration Notice&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Desired Table:&lt;/P&gt;
&lt;P&gt;Issue&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;True&amp;nbsp; &amp;nbsp; &amp;nbsp; False&lt;BR /&gt;Password Expiration Notice&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;High Memory usage Google&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Caluclating False: Line1-Line2 i.e. i need to Subtract count of events with "&lt;STRONG&gt;True [Home]&lt;/STRONG&gt;" from "&lt;STRONG&gt;False&lt;/STRONG&gt;"&lt;/P&gt;
&lt;P&gt;Caluclation True: Number of events with "&lt;STRONG&gt;True&lt;/STRONG&gt;"&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 01:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-table-out-of-this-log-file/m-p/610770#M212407</guid>
      <dc:creator>SS1</dc:creator>
      <dc:date>2022-08-25T01:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a table out of this log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-table-out-of-this-log-file/m-p/610773#M212408</link>
      <description>&lt;P&gt;You may already have fields that exist, but this example assumes the data you supplied is the raw data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval x=split("2022-05-22 02:02:20 PM UTC False [Android] Password Expiration Notice###2022-05-22 06:05:49 PM UTC True [Home] [Android] Password Expiration Notice###2022-05-29 04:24:52 AM UTC False [Android] High Memory usage Google###2022-05-29 06:05:49 PM UTC True [Android] Password Expiration Notice", "###")
| mvexpand x
| fields - _time
| rename x as _raw
| rex "(?&amp;lt;t&amp;gt;\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} \w{2} [^ ]*) (?&amp;lt;bool&amp;gt;(True|False)) ((?&amp;lt;home&amp;gt;\[Home\])? )?(?&amp;lt;platform&amp;gt;\[[^\]]*\]) (?&amp;lt;Issue&amp;gt;.*)"
| stats count(eval(bool="False")) as False count(eval(bool="True")) as True count(eval(home="[Home]")) as Home by Issue
| eval False = False - Home
| table Issue True False&lt;/LI-CODE&gt;&lt;P&gt;rex statement parses out the fields and then the stats does the basic calcs and the False is adjusted at the end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 04:19:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-a-table-out-of-this-log-file/m-p/610773#M212408</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-25T04:19:43Z</dc:date>
    </item>
  </channel>
</rss>

