<?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: How to add free text to table? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590733#M103472</link>
    <description>&lt;P&gt;Datasets cannot be modified.&amp;nbsp; You'll have to store the comments in a lookup table (consider the KVstore) and somehow link it to the dataset.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 16:53:40 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-03-24T16:53:40Z</dc:date>
    <item>
      <title>How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590716#M103464</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have a dataset that I'd like to add a new field to where I can arbitrarily define the values with manual input without downloading and reuploading the data. I've tried editing the table but it seems as though I can only enter a calculated value, some cacatenation of fields and values, or input the same value for every record. Any help is appreciated, thanks!&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;original dataset&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;OG Field 1&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;OG Field 2&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;OG Field 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;UUID&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;timestamp&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;UUID&lt;/TD&gt;&lt;TD&gt;timestamp&lt;/TD&gt;&lt;TD&gt;value&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;new dataset&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;OG Field 1&lt;/TD&gt;&lt;TD width="25%"&gt;OG Field 2&lt;/TD&gt;&lt;TD width="25%"&gt;OG Field 3&lt;/TD&gt;&lt;TD width="25%"&gt;New Field&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;UUID&lt;/TD&gt;&lt;TD width="25%"&gt;timestamp&lt;/TD&gt;&lt;TD width="25%"&gt;value&lt;/TD&gt;&lt;TD width="25%"&gt;I can input anything I want here like a comment on the record&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;UUID&lt;/TD&gt;&lt;TD width="25%"&gt;timestamp&lt;/TD&gt;&lt;TD width="25%"&gt;value&lt;/TD&gt;&lt;TD width="25%"&gt;I can input something different here&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't necessarily need to use tables so if there's another method of adding new fields to datasets from within Splunk I'm open to that as well.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 15:44:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590716#M103464</guid>
      <dc:creator>oh_my_lawdy</dc:creator>
      <dc:date>2022-03-24T15:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590733#M103472</link>
      <description>&lt;P&gt;Datasets cannot be modified.&amp;nbsp; You'll have to store the comments in a lookup table (consider the KVstore) and somehow link it to the dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 16:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590733#M103472</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-03-24T16:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590758#M103478</link>
      <description>&lt;P&gt;I'm not sure what you mean by "dataset" here. Within Splunk it has a very specific meaning pertaining to data models functionality and I'm not entirely sure that's what you mean.&lt;/P&gt;&lt;P&gt;Can you elaborate more precisely what you want to achieve?&lt;/P&gt;&lt;P&gt;As a general rule you can't edit (modify) already indexed data. You can use various search-time methods to calculate dynamicaly created values but they generally, as you noticed, rely on the data you already have. And working in search-time they don't modify the data present i&amp;nbsp; indexes, they just return to you the data in "recalculated" form.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 20:46:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590758#M103478</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-03-24T20:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590760#M103479</link>
      <description>&lt;P&gt;ahh okay, thanks for the good info. I'm pretty new to using Splunk and learning as I go.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wanting to label data for training an MLTK algorithm from within Splunk. The data is a timeseries so reach goal is to chart the data and visually select points where a label should be. Alternatively, I'd like to just be able to label the individual records somehow, maybe with a lookup table?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 21:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590760#M103479</guid>
      <dc:creator>oh_my_lawdy</dc:creator>
      <dc:date>2022-03-24T21:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590763#M103481</link>
      <description>&lt;P&gt;Everyone was new once &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And yes, you can create a lookup from which you'd retrieve labels for your data points. But you need some field or combination of fields to look up by.&lt;/P&gt;&lt;P&gt;Be warned thought that if you have too much data labeled you'll efectively get into territory of effectively duplicating quite a lot of your events into said lookup. So it might be worth considering labeling the data before ingesting it into splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 21:54:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590763#M103481</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-03-24T21:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590884#M103515</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244246"&gt;@oh_my_lawdy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also suggest the same way as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Please check below sample code for your requirement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For KV Store Lookup. Here, you can change the configuration per your requirement.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;collections.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[kvstoreog]
enforceTypes = true
field.new_field = string&lt;/LI-CODE&gt;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[og_info]
external_type = kvstore
case_sensitive_match = true
collection = kvstoreog
fields_list = _key, new_field&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dashboard XML. Kindly change search and the key value as per your requirement.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard script="a.js"&amp;gt;
  &amp;lt;label&amp;gt;add free text to table&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table id="tbl1"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval _raw="OG_Field_1,OG_Field_2,OG_Field_3
0b5377ee2a534a0db231afe84ee9c9b0,timestamp,value1
68a521188b984d2b84e41d35e4ceffa9,timestamp,value2
e646271ee11c4264ba4747519f1ba0e5,timestamp,value3
925fd4c2dc27413384f1a51c11721864,timestamp,value4
b8a9848134a243b684a44e4895da6c8f,timestamp,value5
jjj9848134a243b684a44e4895da6c8f,timestamp,value6
" | multikv forceheader=1
| eval a=10 | accum a
| eval n=1648188616
| eval OG_Field_2 = n - a
| table OG_Field_1 OG_Field_2 OG_Field_3
| rename comment as "Upto now is for sample data only"
| eval New_Field = OG_Field_1."_".OG_Field_2&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search id="search1"&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval _raw="OG_Field_1,OG_Field_2,OG_Field_3
0b5377ee2a534a0db231afe84ee9c9b0,timestamp,value1
68a521188b984d2b84e41d35e4ceffa9,timestamp,value2
e646271ee11c4264ba4747519f1ba0e5,timestamp,value3
925fd4c2dc27413384f1a51c11721864,timestamp,value4
b8a9848134a243b684a44e4895da6c8f,timestamp,value5
jjj9848134a243b684a44e4895da6c8f,timestamp,value6
" | multikv forceheader=1
| eval a=10 | accum a
| eval n=1648188616
| eval OG_Field_2 = n - a
| table OG_Field_1 OG_Field_2 OG_Field_3
| rename comment as "Upto now is for sample data only"
| eval data_key = OG_Field_1."_".OG_Field_2
| lookup og_info _key as data_key&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;a.js&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
    console.log("LAZY!!!");
    var service = mvc.createService({ owner: "nobody" });
    var mySearch = mvc.Components.get("search1");
    // Add overlay buttons to table
    var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            return _(["New_Field"]).contains(cell.field);
        },
        render: function($td, cell) {
            if (cell.field === "New_Field") {
                var strHtmlInput = '&amp;lt;input type="text"&amp;gt;';
                $td.append(strHtmlInput).on("change", function(e) {
                    console.log(e.target.value)
                    console.log("Saved", (new Date).getTime())
                        // Provide Record to store 
                    var record = {
                        "_key": cell.value,
                        "new_field": e.target.value
                    };
                    service.request("storage/collections/data/kvstoreog/" + cell.value, "GET", null, null, null, { "Content-Type": "application/json" }, null).done(function(response) {
                        console.log(response);
                        service.request("storage/collections/data/kvstoreog/" + cell.value, "POST", null, null, JSON.stringify(record), { "Content-Type": "application/json" }, null).done(function() {
                            console.log("Update Done");
                            mySearch.startSearch();
                        });
                    }).error(function(err) {
                        console.log(err.responseText);
                        service.request("storage/collections/data/kvstoreog/", "POST", null, null, JSON.stringify(record), { "Content-Type": "application/json" }, null).done(function() {
                            console.log("Insert Done");
                            mySearch.startSearch();
                        });
                    });
                });
            }
        }
    });

    var sh = mvc.Components.get("tbl1");
    if (typeof(sh) != "undefined") {
        sh.getVisualization(function(tableView) {
            // Add custom cell renderer and force re-render
            tableView.table.addCellRenderer(new CustomRangeRenderer());
            tableView.table.render();
        });
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Screen&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-03-25 at 9.09.03 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18777i1CBD6AACD027A561/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-03-25 at 9.09.03 PM.png" alt="Screenshot 2022-03-25 at 9.09.03 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get batter understanding, please use same configuration and code for POC and do change to play with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 15:40:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590884#M103515</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2022-03-25T15:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590902#M103516</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;, thank you so much! This example is exactly what I needed&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 16:55:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590902#M103516</guid>
      <dc:creator>oh_my_lawdy</dc:creator>
      <dc:date>2022-03-25T16:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590934#M103519</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;, I've been experimenting with the dashboard and script you provided, but my dashboard isn't allow for free text input and instead calculates the `New_Field` value as&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;OG_Field_1 + '_' + OG_Field_2&lt;/LI-CODE&gt;&lt;P&gt;See screenshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oh_my_lawdy_0-1648238456251.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18784i168320F322D2904A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="oh_my_lawdy_0-1648238456251.png" alt="oh_my_lawdy_0-1648238456251.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've added the .conf files to $SPLUNK_HOME/etc/apps/search/local and a.js to $SPLUNK_HOME/etc/apps/search/appserver/static/ and then I created a new dashboard with your XML source code. I then restarted the server.&lt;/P&gt;&lt;P&gt;Is this the correct setup?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 20:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/590934#M103519</guid>
      <dc:creator>oh_my_lawdy</dc:creator>
      <dc:date>2022-03-25T20:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/591016#M103531</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244246"&gt;@oh_my_lawdy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May be we need to bump the javascript.. Just open this link and click on bump button.&lt;/P&gt;&lt;P&gt;&lt;A href="https://localhost:8000/en-US/_bump" target="_blank" rel="noopener"&gt;https://localhost:8000/en-US/_bump&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Open dashboard and right click on dashboard- open Inspect Element and check any error in console?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-03-28 at 10.50.59 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18789i47DB05DBE60F636D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-03-28 at 10.50.59 AM.png" alt="Screenshot 2022-03-28 at 10.50.59 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; If you found any error please share to us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 05:22:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/591016#M103531</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2022-03-28T05:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to add free text to table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/591079#M103539</link>
      <description>&lt;P&gt;That fixed it, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 12:11:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-add-free-text-to-table/m-p/591079#M103539</guid>
      <dc:creator>oh_my_lawdy</dc:creator>
      <dc:date>2022-03-28T12:11:11Z</dc:date>
    </item>
  </channel>
</rss>

