<?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: Displaying Blank Using Data Models in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/700071#M10305</link>
    <description>&lt;P&gt;I think you're lookin for fillnull_value&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/tstats#Optional_arguments" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/tstats#Optional_arguments&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2024 08:57:42 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2024-09-25T08:57:42Z</dc:date>
    <item>
      <title>Displaying Blank Using Data Models</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/298339#M2618</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have data that looks like below, as you can see some parts have blanks.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  Date  |    Time    | UserName |iD     |           Context            |           Command            
20161209|17:28:55.238|MUREXFO   |     1 |LOGIN                         |SPBActUserLogin              
20161209|17:29:02.456|MUREXFO   |     1 |                              |Login                       
20161209|17:29:28.555|MUREXFO   |     2 |Report Selection              |                            
20161209|17:29:32.344|MUREXFO   |     3 |Report Selection NAME         |&amp;amp;Open                     
20161209|17:29:33.404|MUREXFO   |     4 |Creation INFO                 |&amp;amp;Open                    
20161209|17:29:35.966|MUREXFO   |     5 |ADT_OBJDSP                    |                         
20161209|17:29:38.907|MUREXFO   |     6 |Scenario details              |Open
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am able to work whit these with a normal Query, however when i use Data Models i cant.&lt;/P&gt;

&lt;P&gt;Below Query works as i can replace blank with NULL and that is fine - I get 10 entries and it displays &lt;STRONG&gt;NULL&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mlc_log_drop host="mxtiming_qc3"  source="/net/dell425srv/dell425srv/apps/SPLUNK_FILES/MXTIMING_QC3/Resources/logs/MXTIMING/mxtiming_small.log" | fillnull value=NULL |dedup Context |table Context
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However i cant seem to do this with DataModels, I only get 9 entries as NULL is not displayed. I am not sure how to add this at the DataModel level.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count(MXTIMING.CPU) AS count FROM datamodel=MXTIMING where  source="/net/dell425srv/dell425srv/apps/SPLUNK_FILES/MXTIMING_QC3/Resources/logs/MXTIMING/mxtiming_small.log" groupby MXTIMING.Context
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We can see in the image i get 9 results in the tstats and 10 in the normal with &lt;STRONG&gt;NULL&lt;/STRONG&gt;&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2698i7CE8927160BB3D0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2699i2D1E32D8EE5458FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 13:02:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/298339#M2618</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-03-30T13:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Blank Using Data Models</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/298340#M2619</link>
      <description>&lt;P&gt;tstats  groupby is similar to "stats split-by". So, if by field is null, you cannot populate result for null field. &lt;BR /&gt;
So, you need to find a field or combination of fields for groupby.&lt;/P&gt;

&lt;P&gt;I'm not sure if the following search works in your case...but, here is a tstats search example.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats values(MXTIMING.Context) as Context 
         FROM datamodel=MXTIMING 
         where source="*/mxtiming_small.log" 
         groupby MXTIMING.Date MXTIMING.Time MXTIMING.UserName 
         prestats=t
| fillnull value=NULL 
| stats count by Context
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Apr 2017 17:52:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/298340#M2619</guid>
      <dc:creator>Masa</dc:creator>
      <dc:date>2017-04-03T17:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Blank Using Data Models</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/298341#M2620</link>
      <description>&lt;P&gt;Thanks for this. &lt;/P&gt;

&lt;P&gt;I put this in but the performance was a bit slow over Millions of lines as i was doing a lot of calculations after the datamodel. &lt;/P&gt;

&lt;P&gt;In fact you gave me a great idea. &lt;/P&gt;

&lt;P&gt;Soooooo. I changed the datamodel to have Context=if(isnull(Context),"NULL",Context). This worked great as now it has NULL at the datamodel level and i can now get all the data i need with the original query.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 13:41:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/298341#M2620</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2017-04-04T13:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Blank Using Data Models</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/298342#M2621</link>
      <description>&lt;P&gt;glad to hear that you found a good solution.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 21:37:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/298342#M2621</guid>
      <dc:creator>Masa</dc:creator>
      <dc:date>2017-04-05T21:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Blank Using Data Models</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/700071#M10305</link>
      <description>&lt;P&gt;I think you're lookin for fillnull_value&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/tstats#Optional_arguments" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/tstats#Optional_arguments&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 08:57:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Displaying-Blank-Using-Data-Models/m-p/700071#M10305</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2024-09-25T08:57:42Z</dc:date>
    </item>
  </channel>
</rss>

