<?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: Extending a dataset to add a column that represents a numerical column as text in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/630950#M219170</link>
    <description>&lt;P&gt;Thanks, Rich.&amp;nbsp; My mind was on the right approach.&lt;/P&gt;&lt;P&gt;I have two datasets now, one is my main log source and the other I created as a lookup source (I hope that's right?) called "Lookup_Ports_Protocols" (_time, Port, Protocol columns).&amp;nbsp; I assume I want to add a column to my main dataset that looks this up, I don't quite know how to bring that into being.&amp;nbsp; Or do I need to construct a new dataset from these two?&lt;/P&gt;&lt;P&gt;Thanks and sorry for being a bit average at this.&amp;nbsp; I excel at many other things, trust me!&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2023 12:30:36 GMT</pubDate>
    <dc:creator>LeeMoe</dc:creator>
    <dc:date>2023-02-15T12:30:36Z</dc:date>
    <item>
      <title>How to extend a dataset to add a column that represents a numerical column as text?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/630837#M219136</link>
      <description>&lt;P&gt;I have a dataset which has a column "Port" that contains (limited) numerical values.&amp;nbsp; I want to make these values display as text (e.g. 443 == HTTPS).&amp;nbsp; I could do this in Excel but I'm a Splunk newbie and frankly in need of a nudge in the right direction....I assume it would be some kind of lookup?&lt;/P&gt;
&lt;P&gt;I would then pull the text values into a pivot for a dashboard to replace my current one with the port numbers.&lt;/P&gt;
&lt;P&gt;Kudos and virtual shiny things for anyone who can help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 16:48:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/630837#M219136</guid>
      <dc:creator>LeeMoe</dc:creator>
      <dc:date>2023-02-14T16:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extending a dataset to add a column that represents a numerical column as text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/630839#M219138</link>
      <description>&lt;P&gt;Yes, you would use a lookup table.&amp;nbsp; Start by creating a CSV file something like this:&lt;/P&gt;&lt;TABLE border="1" width="75%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Port&lt;/TD&gt;&lt;TD width="50%"&gt;Service&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;22&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;P&gt;ssh&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;80&lt;/TD&gt;&lt;TD width="50%"&gt;HTTP&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;443&lt;/TD&gt;&lt;TD width="50%"&gt;HTTPS&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Call it "ports.csv", for example.&amp;nbsp; Then use the &lt;FONT face="courier new,courier"&gt;lookup&lt;/FONT&gt; command to map port number to service.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| lookup ports.csv Port OUTPUT Service
| table Port Service&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 16:47:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/630839#M219138</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-02-14T16:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extending a dataset to add a column that represents a numerical column as text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/630950#M219170</link>
      <description>&lt;P&gt;Thanks, Rich.&amp;nbsp; My mind was on the right approach.&lt;/P&gt;&lt;P&gt;I have two datasets now, one is my main log source and the other I created as a lookup source (I hope that's right?) called "Lookup_Ports_Protocols" (_time, Port, Protocol columns).&amp;nbsp; I assume I want to add a column to my main dataset that looks this up, I don't quite know how to bring that into being.&amp;nbsp; Or do I need to construct a new dataset from these two?&lt;/P&gt;&lt;P&gt;Thanks and sorry for being a bit average at this.&amp;nbsp; I excel at many other things, trust me!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 12:30:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/630950#M219170</guid>
      <dc:creator>LeeMoe</dc:creator>
      <dc:date>2023-02-15T12:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend a dataset to add a column that represents a numerical column as text?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631009#M219182</link>
      <description>&lt;P&gt;Background: this builds on a &lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-achieve-a-field-extraction-where-field-differs-in/m-p/630178" target="_blank" rel="noopener"&gt;previous question&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I've now imported a CSV file into a new index and stored it in a new table/dataset (ports_protocols)&lt;/P&gt;&lt;P&gt;index=”myindex” | rex "message=\"(?&amp;lt;message&amp;gt;{.+})\" +path="&lt;BR /&gt;| eval message = replace(message, ".\"", "\"")&lt;BR /&gt;| spath input=message&lt;BR /&gt;| lookup ports_protocols Port OUTPUT Protocol | table Port Protocol&lt;/P&gt;&lt;P&gt;Without the lookup, it works perfectly but of course my Port field is numeric and I would like it to be more human-readable.&lt;/P&gt;&lt;P&gt;Clearly I did something wrong up to now.....advice? Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 17:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631009#M219182</guid>
      <dc:creator>LeeMoe</dc:creator>
      <dc:date>2023-02-15T17:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extending a dataset to add a column that represents a numerical column as text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631031#M219187</link>
      <description>&lt;P&gt;Use the same answer I gave earlier, except change the file name and output field name.&lt;/P&gt;&lt;P&gt;BTW, lookup files typically don't contain timestamps.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 18:46:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631031#M219187</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-02-15T18:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend a dataset to add a column that represents a numerical column as text?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631033#M219188</link>
      <description>&lt;P&gt;Why did you index the lookup file?&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;lookup&lt;/FONT&gt; command is used with lookup table files, not indexes or datasets.&amp;nbsp; Use the command with your ports_protocols.csv file.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 18:50:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631033#M219188</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-02-15T18:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend a dataset to add a column that represents a numerical column as text?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631060#M219194</link>
      <description>&lt;P&gt;Rich, thanks, you shook my head enough to go and load the file into a Lookup (duh).&lt;/P&gt;&lt;P&gt;So now I parse my thing and get two columns for Port and Protocol based on my lookup - which is cool.&amp;nbsp; Thank you so much.&amp;nbsp; If I wanted to mix the fields from my index and my lookup, I am sure that's simple to you too (but not to me, sorry).&amp;nbsp; Can you point me in the right direction there too?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="myindex"&lt;BR /&gt;| rex "message=\"(?&amp;lt;message&amp;gt;{.+})\" +path="&lt;BR /&gt;| eval message = replace(message, ".\"", "\"")&lt;BR /&gt;| spath input=message&lt;BR /&gt;| lookup ports_protocols.csv Port OUTPUT Protocol | table Port Protocol&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 20:46:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631060#M219194</guid>
      <dc:creator>LeeMoe</dc:creator>
      <dc:date>2023-02-15T20:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend a dataset to add a column that represents a numerical column as text?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631067#M219198</link>
      <description>&lt;P&gt;Rich, thank you.&amp;nbsp; I now have meaningful things in my dashboard and I am grateful.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="OC-dash-namedports.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23889i1CC97A74A00AE32F/image-size/large?v=v2&amp;amp;px=999" role="button" title="OC-dash-namedports.png" alt="OC-dash-namedports.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Splunk is brilliant and I think you are pretty darn cool too &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 21:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631067#M219198</guid>
      <dc:creator>LeeMoe</dc:creator>
      <dc:date>2023-02-15T21:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend a dataset to add a column that represents a numerical column as text?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631071#M219201</link>
      <description>&lt;P&gt;Thank you, this looks awesome:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OC-dash-namedports.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23890i19E0569D13506BAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="OC-dash-namedports.png" alt="OC-dash-namedports.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 21:19:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extend-a-dataset-to-add-a-column-that-represents-a/m-p/631071#M219201</guid>
      <dc:creator>LeeMoe</dc:creator>
      <dc:date>2023-02-15T21:19:44Z</dc:date>
    </item>
  </channel>
</rss>

