<?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: Can you give me some help with the coalesce command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387198#M112964</link>
    <description>&lt;P&gt;Coalesce is not the command you need here. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval OpCode="Boot_Degradation,Détérioration du démarrage,Información del arranque,Startbeeinträchtigung"

| makemv delim="," OpCode
| eval OpCode=mvindex(OpCode, 0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first two lines make some sample data - hopefully I have interpreted this right?&lt;BR /&gt;
The last two lines make the field multivalued, and then pick the first (0) value in the mv list and returns that value.&lt;/P&gt;

&lt;P&gt;If you wanted french swap the 0 for a 1 etc&lt;/P&gt;

&lt;P&gt;You full search would probably be something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="WinEventLog:Microsoft-Windows-Diagnostics-Performance/Operational"| makemv delim="," OpCode
| eval OpCode=mvindex(OpCode, 0)|table OpCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Feb 2019 14:59:31 GMT</pubDate>
    <dc:creator>nickhills</dc:creator>
    <dc:date>2019-02-13T14:59:31Z</dc:date>
    <item>
      <title>Can you give me some help with the coalesce command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387196#M112962</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;

&lt;P&gt;When I execute the query below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="WinEventLog:Microsoft-Windows-Diagnostics-Performance/Operational"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can display a field called "OpCode". This field has many values and I want to display one of them.&lt;/P&gt;

&lt;P&gt;Sometimes this field is in english, sometimes in French, sometimes in Spanish and sometimes in German.&lt;/P&gt;

&lt;P&gt;So I need to use "coalesce" like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval 'Boot_Degradation'=coalesce('Boot_Degradation','Détérioration du démarrage','Información del arranque','Startbeeinträchtigung') 
| table OpCode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it doesn't work.&lt;/P&gt;

&lt;P&gt;could you help me please???&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 14:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387196#M112962</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-02-13T14:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can you give me some help with the coalesce command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387197#M112963</link>
      <description>&lt;P&gt;Hi @jip31&lt;/P&gt;

&lt;P&gt;Try this, it will take first not null value&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
   | eval OpCode=coalesce(null(),"Détérioration du démarrage","Información del arranque","Startbeeinträchtigung") | table OpCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Feb 2019 14:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387197#M112963</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-02-13T14:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can you give me some help with the coalesce command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387198#M112964</link>
      <description>&lt;P&gt;Coalesce is not the command you need here. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval OpCode="Boot_Degradation,Détérioration du démarrage,Información del arranque,Startbeeinträchtigung"

| makemv delim="," OpCode
| eval OpCode=mvindex(OpCode, 0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first two lines make some sample data - hopefully I have interpreted this right?&lt;BR /&gt;
The last two lines make the field multivalued, and then pick the first (0) value in the mv list and returns that value.&lt;/P&gt;

&lt;P&gt;If you wanted french swap the 0 for a 1 etc&lt;/P&gt;

&lt;P&gt;You full search would probably be something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="WinEventLog:Microsoft-Windows-Diagnostics-Performance/Operational"| makemv delim="," OpCode
| eval OpCode=mvindex(OpCode, 0)|table OpCode
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Feb 2019 14:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387198#M112964</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-02-13T14:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can you give me some help with the coalesce command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387199#M112965</link>
      <description>&lt;P&gt;&lt;CODE&gt;'Boot_Degradation','Détérioration du démarrage','Información del arranque','Startbeeinträchtigung'&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Are those your field names? Or your field  values? The &lt;CODE&gt;coalesce&lt;/CODE&gt; command takes field names as parameters, and returns the first non-null field.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 15:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-give-me-some-help-with-the-coalesce-command/m-p/387199#M112965</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-02-13T15:22:13Z</dc:date>
    </item>
  </channel>
</rss>

