<?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: Why does my int field from mssql database not become an extracted field in Splunk when it is NULL? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110918#M183617</link>
    <description>&lt;P&gt;Thanks! The search statement worked.  I'll see if that can give me everything I need before manipulating the data prior to indexing.  I really appreciate the help!&lt;/P&gt;</description>
    <pubDate>Thu, 13 Nov 2014 17:11:50 GMT</pubDate>
    <dc:creator>krwinters11</dc:creator>
    <dc:date>2014-11-13T17:11:50Z</dc:date>
    <item>
      <title>Why does my int field from mssql database not become an extracted field in Splunk when it is NULL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110913#M183612</link>
      <description>&lt;P&gt;I have an mssql database that I am importing using DB Connect.  I have an int field type that could equal NULL or 1 through 19.  When I search in the splunk search app, this field is not extracted when it is equal to NULL in the database.  Is there a way to get Splunk to extract this still?  I am using a lookup table (csv file) to give the numbers 1-19 definitions.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 18:36:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110913#M183612</guid>
      <dc:creator>krwinters11</dc:creator>
      <dc:date>2014-11-11T18:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my int field from mssql database not become an extracted field in Splunk when it is NULL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110914#M183613</link>
      <description>&lt;P&gt;Can regex help me here?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 16:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110914#M183613</guid>
      <dc:creator>krwinters11</dc:creator>
      <dc:date>2014-11-12T16:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my int field from mssql database not become an extracted field in Splunk when it is NULL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110915#M183614</link>
      <description>&lt;P&gt;I'm not sure I'm totally understanding your question. What is your SQL statement? What should appear in the Splunk output if the int column is zero? &lt;/P&gt;

&lt;P&gt;Could you use the SQL COALESCE function on the int column that's being returned to set it to a value - maybe zero, and add this to your lookup table?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 17:42:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110915#M183614</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2014-11-12T17:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my int field from mssql database not become an extracted field in Splunk when it is NULL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110916#M183615</link>
      <description>&lt;P&gt;Right now I don't have an SQL statement; I'm pulling in the entire table.  In the database, it appears as NULL (if I veiw it in something like SQL Server Management Studio).  When I look at my raw data in Splunk, the field will show up as "fieldName=" and is immediately followed by the next field.  The data doesn't get extracted as a specific field for the events with a NULL value for this field.  Is there a way to set a rule on indexing, or a way to write a regex expression insert a "0" or "NULL" after the equals sign in the events that have a NULL in the database?&lt;BR /&gt;&lt;BR /&gt;
Hopefully that makes more sense.  Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 19:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110916#M183615</guid>
      <dc:creator>krwinters11</dc:creator>
      <dc:date>2014-11-12T19:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my int field from mssql database not become an extracted field in Splunk when it is NULL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110917#M183616</link>
      <description>&lt;P&gt;I think your field is being ingested by Splunk as a null value, It's just that displaying the raw data in Splunk doesn't show NULL in the same way as the SSMS interface does.  &lt;/P&gt;

&lt;P&gt;You can make the field appear as NULL in a search by using an eval statement, something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval fieldname=if(isnull(fieldname),"NULL",fieldname) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The eval won't change the raw data, it'll just change that field's value for the rest of the search. &lt;/P&gt;

&lt;P&gt;Do you really want to manipulate the raw data before indexing it? Personally, I'd need a really good reason to do that in Splunk, as it can adversely affect indexing performance. &lt;/P&gt;

&lt;P&gt;There is a section in the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Anonymizedatausingconfigurationfiles"&gt;Getting Data In documentation regarding anonymizing data&lt;/A&gt; that allows data to be manipulated prior to indexing, you should be able to use that method if you really must.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2014 17:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110917#M183616</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2014-11-13T17:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my int field from mssql database not become an extracted field in Splunk when it is NULL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110918#M183617</link>
      <description>&lt;P&gt;Thanks! The search statement worked.  I'll see if that can give me everything I need before manipulating the data prior to indexing.  I really appreciate the help!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2014 17:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110918#M183617</guid>
      <dc:creator>krwinters11</dc:creator>
      <dc:date>2014-11-13T17:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my int field from mssql database not become an extracted field in Splunk when it is NULL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110919#M183618</link>
      <description>&lt;P&gt;To be clear, a "null field" in Splunk is effectively identical to the field not being present.  (In the internal in-memory representation there's a table, and that column has a null in it for that row, in a csv representation, the distinction bewteen null fields and empty strings is very subtle.)&lt;/P&gt;

&lt;P&gt;Therefore it's pretty likely that Splunk is doing the right thing, but not guaranteed, as failing to do anything would also produce a null field.  Basically any made-up field name you test for that is not defined will be considered null.&lt;/P&gt;

&lt;P&gt;FWIW, I think &lt;CODE&gt;|eval fieldname=coalesce(fieldname, "NULL")&lt;/CODE&gt; reads a little better, but perhaps that's a matter of taste.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Nov 2014 02:08:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110919#M183618</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2014-11-15T02:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my int field from mssql database not become an extracted field in Splunk when it is NULL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110920#M183619</link>
      <description>&lt;P&gt;I think you're right -  I should have used coalesce&lt;/P&gt;</description>
      <pubDate>Sat, 15 Nov 2014 12:52:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-my-int-field-from-mssql-database-not-become-an/m-p/110920#M183619</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2014-11-15T12:52:51Z</dc:date>
    </item>
  </channel>
</rss>

