<?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: scripted alert providing a results.csv with fields containing underscores in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/scripted-alert-providing-a-results-csv-with-fields-containing/m-p/57984#M797</link>
    <description>&lt;P&gt;This is because the mac_addr and ip field contain multiple values (ie. they are multivalue field). You can circumvent this by joining the multivalue fields in your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval mac_addr=mvjoin(mac_addr,", ") | eval ip=mvjoin(ip, ", ")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 May 2012 13:36:14 GMT</pubDate>
    <dc:creator>ziegfried</dc:creator>
    <dc:date>2012-05-23T13:36:14Z</dc:date>
    <item>
      <title>scripted alert providing a results.csv with fields containing underscores</title>
      <link>https://community.splunk.com/t5/Alerting/scripted-alert-providing-a-results-csv-with-fields-containing/m-p/57983#M796</link>
      <description>&lt;P&gt;My full search is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main node_action action=added | eval ip=if(ip=="0.0.0.0",null(),ip) | eval ip_orig=ip | lookup arp mac_addr | eval ip=if(isnull(ip_orig),ip,ip_orig) | eval ip=if(ip="[UNKNOWN]","",ip) | fields - _raw | fields mac_addr ip mac_type | eval mac_addr=mvjoin(mac_addr,", ") | eval ip=mvjoin(ip, ", ") | eval node_type=mvjoin(node_type, ", ") | rename ip as ip_addr |table mac_addr ip_addr mac_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but when i unzip results.csv, I see fields with "__mv_" that I would like to exclude from my csv results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"mac_addr","__mv_mac_addr","ip_addr","__mv_ip_addr","mac_type","__mv_mac_type"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas how to do that?&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2012 21:34:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/scripted-alert-providing-a-results-csv-with-fields-containing/m-p/57983#M796</guid>
      <dc:creator>jaoui</dc:creator>
      <dc:date>2012-05-22T21:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: scripted alert providing a results.csv with fields containing underscores</title>
      <link>https://community.splunk.com/t5/Alerting/scripted-alert-providing-a-results-csv-with-fields-containing/m-p/57984#M797</link>
      <description>&lt;P&gt;This is because the mac_addr and ip field contain multiple values (ie. they are multivalue field). You can circumvent this by joining the multivalue fields in your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval mac_addr=mvjoin(mac_addr,", ") | eval ip=mvjoin(ip, ", ")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2012 13:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/scripted-alert-providing-a-results-csv-with-fields-containing/m-p/57984#M797</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2012-05-23T13:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: scripted alert providing a results.csv with fields containing underscores</title>
      <link>https://community.splunk.com/t5/Alerting/scripted-alert-providing-a-results-csv-with-fields-containing/m-p/57985#M798</link>
      <description>&lt;P&gt;I added that to my search but it does not seem to fix my issue...&lt;/P&gt;

&lt;P&gt;As my search is contains too many characters, I will add it to my initial question&lt;/P&gt;

&lt;P&gt;in the search app, I don't see the additional fields such as "__mv_mac_addr" (even when I do "... | table *" but the results.csv contains them&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:51:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/scripted-alert-providing-a-results-csv-with-fields-containing/m-p/57985#M798</guid>
      <dc:creator>jaoui</dc:creator>
      <dc:date>2020-09-28T11:51:37Z</dc:date>
    </item>
  </channel>
</rss>

