<?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 metrics - if field not present in raw data how to add it with default value? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/metrics-if-field-not-present-in-raw-data-how-to-add-it-with/m-p/477850#M82009</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;In the data source I am ingesting it can happen that one of the fields is not present from time to time. The issue is when I am running a search on it and if I add that dimension to the query that event is not part of the calculation. 

Is it possible to somehow add a field to metrics with a default value if it is not present in the raw event?
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Sep 2019 15:13:28 GMT</pubDate>
    <dc:creator>imrago</dc:creator>
    <dc:date>2019-09-06T15:13:28Z</dc:date>
    <item>
      <title>metrics - if field not present in raw data how to add it with default value?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/metrics-if-field-not-present-in-raw-data-how-to-add-it-with/m-p/477850#M82009</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;In the data source I am ingesting it can happen that one of the fields is not present from time to time. The issue is when I am running a search on it and if I add that dimension to the query that event is not part of the calculation. 

Is it possible to somehow add a field to metrics with a default value if it is not present in the raw event?
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Sep 2019 15:13:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/metrics-if-field-not-present-in-raw-data-how-to-add-it-with/m-p/477850#M82009</guid>
      <dc:creator>imrago</dc:creator>
      <dc:date>2019-09-06T15:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: metrics - if field not present in raw data how to add it with default value?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/metrics-if-field-not-present-in-raw-data-how-to-add-it-with/m-p/477851#M82010</link>
      <description>&lt;P&gt;Have you tried something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=YOURINDEX   FIELD_Name&amp;gt;*  OR NOT FIELD_name
| eval FIELD_Name=if(isnotnull(FIELD_Name), FIELD_Name, "Default value to fill in")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/Search/NOTexpressions"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.1/Search/NOTexpressions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 15:22:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/metrics-if-field-not-present-in-raw-data-how-to-add-it-with/m-p/477851#M82010</guid>
      <dc:creator>solarboyz1</dc:creator>
      <dc:date>2019-09-06T15:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: metrics - if field not present in raw data how to add it with default value?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/metrics-if-field-not-present-in-raw-data-how-to-add-it-with/m-p/477852#M82011</link>
      <description>&lt;P&gt;Agreed, that would work in regular indexes, but I need it for metrics based indexes.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 15:46:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/metrics-if-field-not-present-in-raw-data-how-to-add-it-with/m-p/477852#M82011</guid>
      <dc:creator>imrago</dc:creator>
      <dc:date>2019-09-06T15:46:49Z</dc:date>
    </item>
  </channel>
</rss>

