Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide some fields from Elasticsearch #791

Closed
patrickshan opened this issue Dec 31, 2013 · 13 comments · May be fixed by santosomar/kibana#10 or larrycameron80/kibana#100
Closed

Hide some fields from Elasticsearch #791

patrickshan opened this issue Dec 31, 2013 · 13 comments · May be fixed by santosomar/kibana#10 or larrycameron80/kibana#100

Comments

@patrickshan
Copy link

Hi there,

I found there are some new fields displayed by default in the latest version, such as _id, _index, _type. Is there any way I can configure to hide those fields? Because there is no use for them to be displayed in the search result page.

Thanks

@rashidkpc
Copy link
Contributor

There is currently no way to hide those, we consider them an important part of the record

@jsm-oxa
Copy link

jsm-oxa commented Jan 6, 2014

Hi,

Currently I hide these fields using filters in some modules as the table module:
example: line 30 and 37 in the ng-repeat of the "li" block I add :

ng-repeat="field in fields.list | filter:'!_id' | filter:'!_index' | filter:'!_type'| filter:fieldFilter|orderBy:identity"

Yes it's simple, not really clean and you have to change the original code, but....
Hope this will help you :)

Regards,

@xianfengyuan
Copy link

I have similar issue. Could you point out where to change the filters?

@jsm-oxa
Copy link

jsm-oxa commented Jan 20, 2014

There are two ways to accomplish that:

  • use many filter as I explained (not really clean)
  • add a custom filter (better)

For the first solution : src/app/panels/table/module.html line 30 AND 37 (branch master)
just add/replace the following :

ng-repeat="field in fields.list | filter:'!_id' | filter:'!_index' | filter:'!_type'| filter:fieldFilter|orderBy:identity"

##################
For the other solution, you have to add two functions in src/app/controllers/dash.js

    $scope.excludeFields = function(input) {
      return input != "@timestamp" && input != "@version" && input != "_id" && input != "_type" && input != "_index" && input != "user";
    };

    $scope.excludeHashFields = function(input) {
      var result = {};
      angular.forEach(input, function(value, key) {
        if (key != "@timestamp" && key != "@version" && key != "_id" && key != "_type" && key != "_index" && key != "user") {
          result[key] = value;
        }
      });
      return result;
    };

And now add in src/app/panels/table/module.html line 30 AND 37 (branch master)

ng-repeat="field in current_fields|filter:excludeFields|filter:fieldFilter|orderBy:identity"

and line 98

-   <tr ng-repeat="(key,value) in event.kibana._source track by $index" ng-class-odd="'odd'">
+   <tr ng-repeat="(key,value) in excludeHashFields(event.kibana._source) track by $index" ng-class-odd="'odd'">

Hope this will help you :)

Regards,

@suneethaPVN
Copy link

I tried the first solution.
For the first solution,
it hide only -id,-index,-type
i added host,tags,type fileds those were not hide.
please send a solution for hide the fileds

@jsm-oxa
Copy link

jsm-oxa commented Feb 21, 2014

hummmm I don't have enough time to search why it's effectivly not working using the first solution, BUT It's working perfectly using the seconde solution :)

@suneethaPVN
Copy link

sorry the method is working fine.
Is there any way to rename the field names
ex:slmJson.schedActivityId to ActivityId

@suneethaPVN
Copy link

Hi,
Is there Any solution for
rename the field names ex:slmJson.schedActivityId to ActivityId
Check by default required fields.

@suneethaPVN
Copy link

• Query –
can we set it to regex instead of lucene?
Is there any solution for this?

@commesan
Copy link

commesan commented Sep 6, 2014

I thought it would be nice to have the option to select which fields you want to see in the result. You can set these fields in the panel editor in the same way as you set highlighted fields. If you leave it empty it defaults to showing all fields. If this something anyone else likes this solution I'll submit a pull request.

@rashidkpc
Copy link
Contributor

We do not plan to implement a method for hiding arbitrary fields. HOWEVER, we do allow you to configure the meta data fields in Kibana 4. See the advanced settings section:

screen shot 2014-10-07 at 2 48 33 pm

@sergiomoralesc
Copy link

Hello,
I am currently using Kibana 3.1.2, I tested your suggestion#1 but it doesnt'work. I want to implement your 2nd suggestion but I can't find src/app/controllers/dash.js. Can you point me to the right direction please?
Many thanks

@gdubicki
Copy link

This issue is still valid in Kibana 5...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants